pub struct WgEngine { /* private fields */ }Expand description
Point-to-point Tunn with no socket and no per-packet Vec.
Implementations§
Source§impl WgEngine
impl WgEngine
Sourcepub fn new(
mine: &WgKeypair,
peer: PublicKey,
index: u32,
) -> Result<Self, String>
pub fn new( mine: &WgKeypair, peer: PublicKey, index: u32, ) -> Result<Self, String>
Creates a default WgEngine.
Sourcepub fn has_session(&self) -> bool
pub fn has_session(&self) -> bool
true when session present.
Sourcepub fn encapsulate(
&mut self,
inner: &[u8],
out: &mut [u8],
) -> Result<EngineOut, EngineError>
pub fn encapsulate( &mut self, inner: &[u8], out: &mut [u8], ) -> Result<EngineOut, EngineError>
WgEngine::encapsulate.
Sourcepub fn decapsulate(
&mut self,
pkt: &[u8],
out: &mut [u8],
) -> Result<EngineOut, EngineError>
pub fn decapsulate( &mut self, pkt: &[u8], out: &mut [u8], ) -> Result<EngineOut, EngineError>
Decapsulates a WireGuard packet.
Auto Trait Implementations§
impl !Freeze for WgEngine
impl !RefUnwindSafe for WgEngine
impl !UnwindSafe for WgEngine
impl Send for WgEngine
impl Sync for WgEngine
impl Unpin for WgEngine
impl UnsafeUnpin for WgEngine
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more