pub struct Incoming(/* private fields */);展开描述
一个尚未由服务器开始其握手部分的入站连接
实现§
源代码§impl Incoming
impl Incoming
源代码pub fn accept(self) -> Result<Connecting, ConnectionError>
pub fn accept(self) -> Result<Connecting, ConnectionError>
尝试接受此入站连接(仍可能发生错误)
源代码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()。
源代码pub fn retry(self) -> Result<(), RetryError>
pub fn retry(self) -> Result<(), RetryError>
回送一个 retry 包,要求客户端带地址校验后重试
若 may_retry() 为 false,则会出错。
源代码pub fn remote_address(&self) -> SocketAddr
pub fn remote_address(&self) -> SocketAddr
对端的 UDP 地址
源代码pub fn remote_address_validated(&self) -> bool
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
pub fn may_retry(&self) -> bool
是否可以合法地回送 retry 包
若 self.remote_address_validated() 为 false,则 self.may_retry() 一定为 true;反之则不一定。
源代码pub fn orig_dst_cid(&self) -> ConnectionId
pub fn orig_dst_cid(&self) -> ConnectionId
发起该连接时使用的原始目标 CID
trait 实现§
源代码§impl IntoFuture for Incoming
impl IntoFuture for Incoming
源代码§type Output = Result<Connection, ConnectionError>
type Output = Result<Connection, ConnectionError>
Future 完成时产生的输出。
源代码§type IntoFuture = IncomingFuture
type IntoFuture = IncomingFuture
我们将要把此值转变成哪种 future?
源代码§fn into_future(self) -> Self::IntoFuture
fn into_future(self) -> Self::IntoFuture
Creates a future from a value. 更多信息
自动 trait 实现§
impl !Freeze for Incoming
impl !RefUnwindSafe for Incoming
impl Send for Incoming
impl Sync for Incoming
impl Unpin for Incoming
impl UnsafeUnpin for Incoming
impl !UnwindSafe for Incoming
blanket 实现§
源代码§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
源代码§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. 更多信息