pub struct TransportClose {
pub code: Option<u16>,
pub reason: String,
pub was_clean: bool,
}Expand description
Details reported when a transport connection closes.
Fields§
§code: Option<u16>WebSocket close code, if a close frame was received.
reason: StringHuman-readable close reason.
was_clean: boolWhether the transport considered the close handshake clean.
Implementations§
Source§impl TransportClose
impl TransportClose
Sourcepub fn new(
code: Option<u16>,
reason: impl Into<String>,
was_clean: bool,
) -> Self
pub fn new( code: Option<u16>, reason: impl Into<String>, was_clean: bool, ) -> Self
Creates close details reported by a transport.
Sourcepub fn connection_ended() -> Self
pub fn connection_ended() -> Self
Creates an abnormal close for a stream that ended without a close frame.
Sourcepub fn should_reconnect(&self) -> bool
pub fn should_reconnect(&self) -> bool
Returns whether the managed client should reconnect this close by default.
Trait Implementations§
Source§impl Clone for TransportClose
impl Clone for TransportClose
Source§fn clone(&self) -> TransportClose
fn clone(&self) -> TransportClose
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TransportClose
impl Debug for TransportClose
Source§impl PartialEq for TransportClose
impl PartialEq for TransportClose
Source§fn eq(&self, other: &TransportClose) -> bool
fn eq(&self, other: &TransportClose) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for TransportClose
impl StructuralPartialEq for TransportClose
Auto Trait Implementations§
impl Freeze for TransportClose
impl RefUnwindSafe for TransportClose
impl Send for TransportClose
impl Sync for TransportClose
impl Unpin for TransportClose
impl UnsafeUnpin for TransportClose
impl UnwindSafe for TransportClose
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