Struct Incoming
pub struct Incoming(/* private fields */);quic and std only.Expand description
An incoming connection for which the server has not yet begun its part of the handshake
Implementations§
§impl Incoming
impl Incoming
pub fn accept(self) -> Result<Connecting, ConnectionError>
pub fn accept(self) -> Result<Connecting, ConnectionError>
Attempt to accept this incoming connection (an error may still occur)
pub fn accept_with(
self,
server_config: Arc<ServerConfig>,
) -> Result<Connecting, ConnectionError>
pub fn accept_with( self, server_config: Arc<ServerConfig>, ) -> Result<Connecting, ConnectionError>
Accept this incoming connection using a custom configuration
See accept() for more details.
pub fn refuse(self)
pub fn refuse(self)
Reject this incoming connection attempt
pub fn retry(self) -> Result<(), RetryError>
pub fn retry(self) -> Result<(), RetryError>
Respond with a retry packet, requiring the client to retry with address validation
Errors if may_retry() is false.
pub fn ignore(self)
pub fn ignore(self)
Ignore this incoming connection attempt, not sending any packet in response
pub fn local_ip(&self) -> Option<IpAddr>
pub fn local_ip(&self) -> Option<IpAddr>
The local IP address which was used when the peer established the connection
pub fn remote_address(&self) -> SocketAddr
pub fn remote_address(&self) -> SocketAddr
The peer’s UDP address
pub fn remote_address_validated(&self) -> bool
pub fn remote_address_validated(&self) -> bool
Whether the socket address that is initiating this connection has been validated
This means that the sender of the initial packet has proved that they can receive traffic
sent to self.remote_address().
Before expiry, if self.remote_address_validated() is false, self.may_retry() is true.
The inverse is not guaranteed.
pub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Whether this pending attempt has expired or was retired by endpoint shutdown.
pub fn may_retry(&self) -> bool
pub fn may_retry(&self) -> bool
Whether it is legal to respond with a retry packet
Before expiry, if self.remote_address_validated() is false, self.may_retry() is true.
The inverse is not guaranteed.
pub fn orig_dst_cid(&self) -> ConnectionId
pub fn orig_dst_cid(&self) -> ConnectionId
The original destination CID when initiating the connection
Trait Implementations§
§impl IntoFuture for Incoming
impl IntoFuture for Incoming
§type Output = Result<Connection, ConnectionError>
type Output = Result<Connection, ConnectionError>
§type IntoFuture = IncomingFuture
type IntoFuture = IncomingFuture
§fn into_future(self) -> <Incoming as IntoFuture>::IntoFuture
fn into_future(self) -> <Incoming as IntoFuture>::IntoFuture
Auto Trait Implementations§
impl !Freeze for Incoming
impl !RefUnwindSafe for Incoming
impl !UnwindSafe for Incoming
impl Send for Incoming
impl Sync for Incoming
impl Unpin for Incoming
impl UnsafeUnpin for Incoming
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a rama_grpc::Request§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more