pub struct AllowAll;Expand description
The explicit “no gate”: admits every connection in Lane(0) with GateTag(0) and never denies.
use net_io::{AdmitStage, AllowAll, ConnectionInfo, Gate};
let info = ConnectionInfo::for_testing("127.0.0.1:1".parse().unwrap());
assert!(AllowAll.admit(&info, AdmitStage::Accept).is_ok());Trait Implementations§
impl Copy for AllowAll
Source§impl Gate for AllowAll
impl Gate for AllowAll
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 Freeze for AllowAll
impl RefUnwindSafe for AllowAll
impl Send for AllowAll
impl Sync for AllowAll
impl Unpin for AllowAll
impl UnsafeUnpin for AllowAll
impl UnwindSafe for AllowAll
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