Struct medea_jason::rpc::Heartbeat
source · pub struct Heartbeat(_);
Expand description
Detector of connection loss via ping/pong mechanism.
Implementations§
source§impl Heartbeat
impl Heartbeat
sourcepub fn start(
transport: Rc<dyn RpcTransport>,
ping_interval: PingInterval,
idle_timeout: IdleTimeout
) -> Self
pub fn start( transport: Rc<dyn RpcTransport>, ping_interval: PingInterval, idle_timeout: IdleTimeout ) -> Self
Starts this Heartbeat
for the provided platform::RpcTransport
with the provided idle_timeout
and ping_interval
.
sourcepub fn update_settings(
&self,
idle_timeout: IdleTimeout,
ping_interval: PingInterval
)
pub fn update_settings( &self, idle_timeout: IdleTimeout, ping_interval: PingInterval )
Updates this Heartbeat
settings.
sourcepub fn on_idle(&self) -> LocalBoxStream<'static, ()>
pub fn on_idle(&self) -> LocalBoxStream<'static, ()>
Returns [LocalBoxStream
] to which will sent ()
when Heartbeat
considers that platform::RpcTransport
is idle.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Heartbeat
impl !Send for Heartbeat
impl !Sync for Heartbeat
impl Unpin for Heartbeat
impl !UnwindSafe for Heartbeat
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