pub struct EstablishedConnection<'a, TInEvent> { /* private fields */ }Expand description
An established connection in a pool.
Implementations§
Source§impl<TInEvent> EstablishedConnection<'_, TInEvent>
impl<TInEvent> EstablishedConnection<'_, TInEvent>
pub fn connected(&self) -> &Connected
Sourcepub fn endpoint(&self) -> &ConnectedPoint
pub fn endpoint(&self) -> &ConnectedPoint
Returns information about the connected endpoint.
Sourcepub fn id(&self) -> ConnectionId
pub fn id(&self) -> ConnectionId
Returns the local connection ID.
Sourcepub fn notify_handler(&mut self, event: TInEvent) -> Result<(), TInEvent>
pub fn notify_handler(&mut self, event: TInEvent) -> Result<(), TInEvent>
(Asynchronously) sends an event to the connection handler.
If the handler is not ready to receive the event, either because
it is busy or the connection is about to close, the given event
is returned with an Err.
If execution of this method is preceded by successful execution of
poll_ready_notify_handler without another intervening execution
of notify_handler, it only fails if the connection is now about
to close.
Sourcepub fn poll_ready_notify_handler(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<(), ()>>
pub fn poll_ready_notify_handler( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<(), ()>>
Checks if notify_handler is ready to accept an event.
Returns Ok(()) if the handler is ready to receive an event via notify_handler.
Returns Err(()) if the background task associated with the connection
is terminating and the connection is about to close.
Sourcepub fn start_close(self)
pub fn start_close(self)
Initiates a graceful close of the connection.
Has no effect if the connection is already closing.
Trait Implementations§
Auto Trait Implementations§
impl<'a, TInEvent> Freeze for EstablishedConnection<'a, TInEvent>
impl<'a, TInEvent> !RefUnwindSafe for EstablishedConnection<'a, TInEvent>
impl<'a, TInEvent> Send for EstablishedConnection<'a, TInEvent>where
TInEvent: Send,
impl<'a, TInEvent> Sync for EstablishedConnection<'a, TInEvent>where
TInEvent: Send,
impl<'a, TInEvent> Unpin for EstablishedConnection<'a, TInEvent>
impl<'a, TInEvent> !UnwindSafe for EstablishedConnection<'a, TInEvent>
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
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>
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>
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