pub struct ControlSocket { /* private fields */ }Expand description
A session’s control socket. Dropping it ends the session: the router tears a session down within half a second of its control socket closing.
Implementations§
Source§impl ControlSocket
impl ControlSocket
Sourcepub fn address(&self) -> Option<&str>
pub fn address(&self) -> Option<&str>
The session’s own .b32.i2p address, when the router told us.
Sourcepub async fn next_event(&mut self) -> ControlEvent
pub async fn next_event(&mut self) -> ControlEvent
Wait for the router to say something. Cancel-safe: a partial line stays buffered.
Auto Trait Implementations§
impl !Freeze for ControlSocket
impl Forget for ControlSocket
impl Move for ControlSocket
impl RefUnwindSafe for ControlSocket
impl Send for ControlSocket
impl Sync for ControlSocket
impl Unpin for ControlSocket
impl UnsafeUnpin for ControlSocket
impl UnwindSafe for ControlSocket
Blanket Implementations§
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> 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