pub struct SessionEntry<T, E = SessionError> { /* private fields */ }Expand description
One session’s payload, and the signal that it has been established.
Implementations§
Source§impl<T: Clone, E: Clone> SessionEntry<T, E>
impl<T: Clone, E: Clone> SessionEntry<T, E>
Sourcepub async fn wait_ready(&self) -> Established<T, E>
pub async fn wait_ready(&self) -> Established<T, E>
Waits until this session has been established, one way or the other.
Follows Notify’s race-free pattern: the notified future is created
before the readiness check, so a notify_waiters() landing between the
check and the await is not missed. The loop covers a spurious wake-up,
which would otherwise return before the session existed.
Sourcepub fn outcome(&self) -> Option<Established<T, E>>
pub fn outcome(&self) -> Option<Established<T, E>>
How establishing this session turned out, or None if it has not been
attempted yet. Unlike wait_ready this does not wait
for the answer.
Sourcepub fn publish(&self, outcome: Established<T, E>)
pub fn publish(&self, outcome: Established<T, E>)
Publishes the outcome of establishing this session.
A failure is published rather than swallowed so that waiters fail with the reason the session was never established, instead of hanging.
Trait Implementations§
Auto Trait Implementations§
impl<T, E = SessionError> !Freeze for SessionEntry<T, E>
impl<T, E> RefUnwindSafe for SessionEntry<T, E>
impl<T, E> Send for SessionEntry<T, E>
impl<T, E> Sync for SessionEntry<T, E>
impl<T, E> Unpin for SessionEntry<T, E>
impl<T, E> UnsafeUnpin for SessionEntry<T, E>
impl<T, E> UnwindSafe for SessionEntry<T, E>
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