pub struct NoGate;Expand description
The builder’s gate until ServerBuilder::gate names one: every connection is
admitted, in the most important lane, as with AllowAll, and
no gate check runs on the write path.
use net_io::{AdmitStage, ConnectionInfo, Gate, NoGate};
let info = ConnectionInfo::for_testing("127.0.0.1:9".parse().unwrap());
assert!(NoGate.admit(&info, AdmitStage::Accept).is_ok());Trait Implementations§
impl Copy for NoGate
Source§impl Gate for NoGate
impl Gate for NoGate
Source§fn admit(
&self,
_info: &ConnectionInfo,
_stage: AdmitStage,
) -> Result<Admitted<()>, Refusal>
fn admit( &self, _info: &ConnectionInfo, _stage: AdmitStage, ) -> Result<Admitted<()>, Refusal>
After accept and before any read (
Accept), on Server::adopt (Adopt),
or when a client connection gets a gate (Dialed). Read moreSource§fn readmit(
&self,
_ticket: &mut (),
_info: &ConnectionInfo,
) -> Result<(), Refusal>
fn readmit( &self, _ticket: &mut (), _info: &ConnectionInfo, ) -> Result<(), Refusal>
After a trusted PROXY header revealed the real client (
info.real_peer is set). Read moreSource§fn check(&self, _ticket: &mut (), _write: &WriteCheck) -> Result<(), Denial>
fn check(&self, _ticket: &mut (), _write: &WriteCheck) -> Result<(), Denial>
Before every write system call. The path where nothing is revoked should be one atomic load. Read more
Source§fn closed(
&self,
ticket: Self::Ticket,
info: &ConnectionInfo,
reason: CloseReason,
)
fn closed( &self, ticket: Self::Ticket, info: &ConnectionInfo, reason: CloseReason, )
Exactly once per admitted connection, after it closed, with its one close reason.
Auto Trait Implementations§
impl Forget for NoGate
impl Freeze for NoGate
impl Move for NoGate
impl RefUnwindSafe for NoGate
impl Send for NoGate
impl Sync for NoGate
impl Unpin for NoGate
impl UnsafeUnpin for NoGate
impl UnwindSafe for NoGate
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