pub struct AcceptGuard { /* private fields */ }Expand description
Allows a tentatively accepted connection to be rejected afterwards.
Dropping this guard confirms the connection.
Implementations§
Source§impl AcceptGuard
impl AcceptGuard
Sourcepub fn accept(self)
pub fn accept(self)
Confirms the connection that was tentatively accepted.
This is equivalent to dropping the guard.
Sourcepub async fn reject(self, no_ports: bool)
pub async fn reject(self, no_ports: bool)
Rejects the connection that was tentatively accepted.
Setting no_ports to true indicates to the remote endpoint that the request
was rejected because no local port could be allocated.
The requester observes this like the rejection of a pre-connected port, i.e. its
sender and receiver fail with
SendError::Rejected and
RecvError::Rejected. Data that was already
exchanged over the port is discarded.
The sender and receiver of the tentatively accepted port should be dropped, since the requester is only notified when the port is closed.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AcceptGuard
impl RefUnwindSafe for AcceptGuard
impl Send for AcceptGuard
impl Sync for AcceptGuard
impl Unpin for AcceptGuard
impl UnsafeUnpin for AcceptGuard
impl UnwindSafe for AcceptGuard
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