pub struct Heartbeat<S> { /* private fields */ }
Expand description
Wrapper for a muxado TypedSession that adds heartbeating over a dedicated typed stream.
Implementations§
Source§impl<S> Heartbeat<S>where
S: TypedSession + 'static,
impl<S> Heartbeat<S>where
S: TypedSession + 'static,
Sourcepub async fn start(
sess: S,
cfg: HeartbeatConfig,
) -> Result<(Self, HeartbeatCtl), Error>
pub async fn start( sess: S, cfg: HeartbeatConfig, ) -> Result<(Self, HeartbeatCtl), Error>
Wrap a typed session and start the heartbeat task. Returns an error if the stream can’t be opened.
Trait Implementations§
Source§impl<S> TypedAccept for Heartbeat<S>where
S: TypedAccept + Send,
impl<S> TypedAccept for Heartbeat<S>where
S: TypedAccept + Send,
Source§impl<S> TypedOpenClose for Heartbeat<S>where
S: TypedOpenClose + Send,
impl<S> TypedOpenClose for Heartbeat<S>where
S: TypedOpenClose + Send,
Source§fn open_typed<'life0, 'async_trait>(
&'life0 mut self,
typ: StreamType,
) -> Pin<Box<dyn Future<Output = Result<TypedStream, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn open_typed<'life0, 'async_trait>(
&'life0 mut self,
typ: StreamType,
) -> Pin<Box<dyn Future<Output = Result<TypedStream, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Open a typed stream with the given type.
Source§impl<S> TypedSession for Heartbeat<S>
impl<S> TypedSession for Heartbeat<S>
Source§type TypedAccept = Heartbeat<<S as TypedSession>::TypedAccept>
type TypedAccept = Heartbeat<<S as TypedSession>::TypedAccept>
The component implementing TypedAccept.
Source§type TypedOpen = Heartbeat<<S as TypedSession>::TypedOpen>
type TypedOpen = Heartbeat<<S as TypedSession>::TypedOpen>
The component implementing [TypedOpen].
Source§fn split_typed(self) -> (Self::TypedOpen, Self::TypedAccept)
fn split_typed(self) -> (Self::TypedOpen, Self::TypedAccept)
Split the typed session into open/accept components.
Auto Trait Implementations§
impl<S> Freeze for Heartbeat<S>where
S: Freeze,
impl<S> !RefUnwindSafe for Heartbeat<S>
impl<S> Send for Heartbeat<S>where
S: Send,
impl<S> Sync for Heartbeat<S>where
S: Sync,
impl<S> Unpin for Heartbeat<S>where
S: Unpin,
impl<S> !UnwindSafe for Heartbeat<S>
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