#[repr(C)]pub struct ConnectionCloseFrame {
pub error_code: u64,
pub frame_type: Option<u64>,
pub reason_phrase_length: u64,
pub reason_phrase: Bytes,
}
Expand description
An endpoint sends a CONNECTION_CLOSE frame (type=0x1c or 0x1d) to notify its peer that the connection is being closed. The CONNECTION_CLOSE with a frame type of 0x1c is used to signal errors at only the QUIC layer, or the absence of errors (with the NO_ERROR code). The CONNECTION_CLOSE frame with a type of 0x1d is used to signal an error with the application that uses QUIC.
If there are open streams that have not been explicitly closed, they are implicitly closed when the connection is closed.
Fields§
§error_code: u64
A variable-length integer error code that indicates the reason for closing this connection. A CONNECTION_CLOSE frame of type 0x1c uses codes from the space. A CONNECTION_CLOSE frame of type 0x1d uses codes from the application protocol error code space.
frame_type: Option<u64>
A variable-length integer encoding the type of frame that triggered the error. A value of 0 (equivalent to the mention of the PADDING frame) is used when the frame type is unknown. The application-specific variant of CONNECTION_CLOSE (type 0x1d) does not include this field.
reason_phrase_length: u64
A variable-length integer specifying the length of the reason phrase in bytes. Because a CONNECTION_CLOSE frame cannot be split between packets, any limits on packet size will also limit the space available for a reason phrase.
reason_phrase: Bytes
A human-readable explanation for why the connection was closed. This can be zero length if the sender chooses not to give details beyond the Error Code. This SHOULD be a UTF-8 encoded string [RFC3629].
Trait Implementations§
Source§impl Clone for ConnectionCloseFrame
impl Clone for ConnectionCloseFrame
Source§fn clone(&self) -> ConnectionCloseFrame
fn clone(&self) -> ConnectionCloseFrame
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ConnectionCloseFrame
impl Debug for ConnectionCloseFrame
Source§impl<'de> Deserialize<'de> for ConnectionCloseFrame
impl<'de> Deserialize<'de> for ConnectionCloseFrame
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ConnectionCloseFrame, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ConnectionCloseFrame, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for ConnectionCloseFrame
impl PartialEq for ConnectionCloseFrame
Source§impl PartialOrd for ConnectionCloseFrame
impl PartialOrd for ConnectionCloseFrame
Source§impl Serialize for ConnectionCloseFrame
impl Serialize for ConnectionCloseFrame
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Copy for ConnectionCloseFrame
impl Eq for ConnectionCloseFrame
impl StructuralPartialEq for ConnectionCloseFrame
Auto Trait Implementations§
impl Freeze for ConnectionCloseFrame
impl RefUnwindSafe for ConnectionCloseFrame
impl Send for ConnectionCloseFrame
impl Sync for ConnectionCloseFrame
impl Unpin for ConnectionCloseFrame
impl UnwindSafe for ConnectionCloseFrame
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out
indicating that a T
is niched.