跳到主要内容

Incoming

搜索

结构体 Incoming 

源代码
pub struct Incoming(/* private fields */);
展开描述

一个尚未由服务器开始其握手部分的入站连接

实现§

源代码§

impl Incoming

源代码

pub fn accept(self) -> Result<Connecting, ConnectionError>

尝试接受此入站连接(仍可能发生错误)

源代码

pub fn accept_with( self, server_config: Arc<ServerConfig>, ) -> Result<Connecting, ConnectionError>

使用自定义配置接受此入站连接

详见 accept()

源代码

pub fn refuse(self)

拒绝此次入站连接尝试

源代码

pub fn retry(self) -> Result<(), RetryError>

回送一个 retry 包,要求客户端带地址校验后重试

may_retry() 为 false,则会出错。

源代码

pub fn ignore(self)

忽略此次入站连接尝试,不回送任何包

源代码

pub fn local_ip(&self) -> Option<IpAddr>

对端建立连接时所使用的本地 IP 地址

源代码

pub fn remote_address(&self) -> SocketAddr

对端的 UDP 地址

源代码

pub fn remote_address_validated(&self) -> bool

发起此次连接的套接字地址是否已通过验证

这表示初始包的发送者已证明自己能够接收发往 self.remote_address() 的数据。

self.remote_address_validated() 为 false,则 self.may_retry() 一定为 true;反之则不一定。

源代码

pub fn may_retry(&self) -> bool

是否可以合法地回送 retry 包

self.remote_address_validated() 为 false,则 self.may_retry() 一定为 true;反之则不一定。

源代码

pub fn orig_dst_cid(&self) -> ConnectionId

发起该连接时使用的原始目标 CID

trait 实现§

源代码§

impl Debug for Incoming

源代码§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

使用给定的格式化器格式化此值。 更多信息
源代码§

impl Drop for Incoming

源代码§

fn drop(&mut self)

执行此类型的析构函数。 更多信息
源代码§

impl IntoFuture for Incoming

源代码§

type Output = Result<Connection, ConnectionError>

The output that the future will produce on completion.
源代码§

type IntoFuture = IncomingFuture

Which kind of future are we turning this into?
源代码§

fn into_future(self) -> Self::IntoFuture

Creates a future from a value. 更多信息

自动 trait 实现§

blanket 实现§

源代码§

impl<T> Any for T
where T: 'static + ?Sized,

源代码§

fn type_id(&self) -> TypeId

Gets the TypeId of self. 更多信息
源代码§

impl<T> Borrow<T> for T
where T: ?Sized,

源代码§

fn borrow(&self) -> &T

Immutably borrows from an owned value. 更多信息
源代码§

impl<T> BorrowMut<T> for T
where T: ?Sized,

源代码§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. 更多信息
源代码§

impl<T> From<T> for T

源代码§

fn from(t: T) -> T

原样返回该参数。

源代码§

impl<T> Instrument for T

源代码§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. 更多信息
源代码§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. 更多信息
源代码§

impl<T, U> Into<U> for T
where U: From<T>,

源代码§

fn into(self) -> U

调用 U::from(self)

也就是说,此转换行为完全由 From<T> for U 的实现决定。

源代码§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

源代码§

type Error = Infallible

The type returned in the event of a conversion error.
源代码§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

执行转换。
源代码§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

源代码§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
源代码§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

执行转换。
源代码§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

源代码§

fn vzip(self) -> V

源代码§

impl<T> WithSubscriber for T

源代码§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. 更多信息
源代码§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. 更多信息
源代码§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

源代码§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

源代码§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,