struct KeepAlive {
interval: Duration,
timeout: Duration,
while_idle: bool,
state: KeepAliveState,
sleep: Pin<Box<dyn Sleep>>,
timer: Time,
}
Fields§
§interval: Duration
If no frames are received in this amount of time, a PING frame is sent.
timeout: Duration
After sending a keepalive PING, the connection will be closed if a pong is not received in this amount of time.
while_idle: bool
If true, sends pings even when there are no active streams.
state: KeepAliveState
§sleep: Pin<Box<dyn Sleep>>
§timer: Time
Implementations§
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 !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