pub struct Session<S> { /* private fields */ }Implementations§
Source§impl<S> Session<S>
impl<S> Session<S>
pub fn new( io: S, data_producer: DataProducer, publish_request_producer: PublishProducer, ) -> Self
pub fn uid(&self) -> Option<UniqueID>
Source§impl<S: AsyncRead + AsyncWrite + Unpin> Session<S>
impl<S: AsyncRead + AsyncWrite + Unpin> Session<S>
Sourcepub async fn run(&mut self) -> Result<bool, SessionError>
pub async fn run(&mut self) -> Result<bool, SessionError>
Run the session to completion The result of the return value will be true if all publishers have disconnected If any publishers are still connected, the result will be false This can be used to detect non-graceful disconnects (ie. the client crashed)
Auto Trait Implementations§
impl<S> Freeze for Session<S>where
S: Freeze,
impl<S> RefUnwindSafe for Session<S>where
S: RefUnwindSafe,
impl<S> Send for Session<S>where
S: Send,
impl<S> Sync for Session<S>where
S: Sync,
impl<S> Unpin for Session<S>where
S: Unpin,
impl<S> UnwindSafe for Session<S>where
S: UnwindSafe,
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