diff options
author | HimbeerserverDE <himbeerserverde@gmail.com> | 2023-11-18 12:42:12 +0100 |
---|---|---|
committer | HimbeerserverDE <himbeerserverde@gmail.com> | 2023-11-18 12:42:12 +0100 |
commit | 4c1b3e1f637ce7cb0825ea1e00eb492888777d00 (patch) | |
tree | 40d0a4c377babfcac31996e7515bc81f74e40f31 | |
parent | d19fda8ff4003113c9760189808293594f856a91 (diff) |
add blocking connection constructor0.4.1
-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<()> { |