diff options
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | src/blocking.rs | 7 |
2 files changed, 8 insertions, 1 deletions
@@ -1,6 +1,6 @@ [package] name = "rsdsl_netlinklib" -version = "0.4.0" +version = "0.4.1" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/src/blocking.rs b/src/blocking.rs index 7e9a92b..2ac66e9 100644 --- a/src/blocking.rs +++ b/src/blocking.rs @@ -13,6 +13,13 @@ pub use crate::tunnel; #[derive(Debug)] pub struct Connection(crate::Connection); +impl Connection { + /// Creates a new blocking wrapper around [`crate::Connection`]. + pub fn new() -> crate::Result<Self> { + Ok(Self(crate::Connection::new()?)) + } +} + macro_rules! blockify { ($blk:ident) => { pub fn $blk(&self) -> crate::Result<()> { |