struct KeepAlive {
interval: Duration,
timeout: Duration,
while_idle: bool,
state: KeepAliveState,
sleep: Pin<Box<dyn Sleep>>,
timer: Time,
}Fields§
§interval: DurationIf no frames are received in this amount of time, a PING frame is sent.
timeout: DurationAfter sending a keepalive PING, the connection will be closed if a pong is not received in this amount of time.
while_idle: boolIf true, sends pings even when there are no active streams.
state: KeepAliveState§sleep: Pin<Box<dyn Sleep>>§timer: TimeImplementations§
Source§impl KeepAlive
impl KeepAlive
fn maybe_schedule(&mut self, is_idle: bool, shared: &Shared)
fn schedule(&mut self, shared: &Shared)
fn maybe_ping( &mut self, cx: &mut Context<'_>, is_idle: bool, shared: &mut Shared, )
fn maybe_timeout( &mut self, cx: &mut Context<'_>, ) -> Result<(), KeepAliveTimedOut>
Auto Trait Implementations§
impl Freeze for KeepAlive
impl !RefUnwindSafe for KeepAlive
impl Send for KeepAlive
impl Sync for KeepAlive
impl Unpin for KeepAlive
impl UnsafeUnpin for KeepAlive
impl !UnwindSafe for KeepAlive
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