#[non_exhaustive]pub enum Refusal {
Reset {
code: u16,
},
WithBytes {
code: u16,
bytes: &'static [u8],
},
}Expand description
How a connection is refused.
let r = net_io::Refusal::WithBytes { code: 3, bytes: b"HTTP/1.1 503 Service Unavailable\r\nRetry-After: 5\r\n\r\n" };
assert_eq!(r.code(), 3);Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Reset
Close with RST.
WithBytes
Write these bytes once (non-blocking, at most Limits::refusal_bytes_max),
then FIN: at admission the close follows at once (the accept thread does not
wait, and input the peer already sent turns it into a reset); after a PROXY
header (readmit) a linger of at most Limits::denial_linger reads and
discards first. RST when nothing was sent or that linger is zero.
Implementations§
Trait Implementations§
impl Copy for Refusal
impl Eq for Refusal
impl StructuralPartialEq for Refusal
Auto Trait Implementations§
impl Forget for Refusal
impl Freeze for Refusal
impl Move for Refusal
impl RefUnwindSafe for Refusal
impl Send for Refusal
impl Sync for Refusal
impl Unpin for Refusal
impl UnsafeUnpin for Refusal
impl UnwindSafe for Refusal
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