pub struct Connection(/* private fields */);Implementations§
Source§impl Connection
impl Connection
Sourcepub fn new(registration: &Registration) -> Result<Self, ConnectionError>
pub fn new(registration: &Registration) -> Result<Self, ConnectionError>
Create a new connection.
The connection is not started until start is called.
Sourcepub fn start<'a>(
&'a self,
configuration: &'a Configuration,
host: &'a str,
port: u16,
) -> ConnectionStart<'a>
pub fn start<'a>( &'a self, configuration: &'a Configuration, host: &'a str, port: u16, ) -> ConnectionStart<'a>
Start the connection.
Sourcepub fn open_outbound_stream(
&self,
stream_type: StreamType,
fail_on_blocked: bool,
) -> OpenOutboundStream<'_> ⓘ
pub fn open_outbound_stream( &self, stream_type: StreamType, fail_on_blocked: bool, ) -> OpenOutboundStream<'_> ⓘ
Open a new outbound stream.
Sourcepub fn accept_inbound_stream(&self) -> AcceptInboundStream<'_> ⓘ
pub fn accept_inbound_stream(&self) -> AcceptInboundStream<'_> ⓘ
Accept an inbound bidilectional stream.
Sourcepub fn poll_accept_inbound_stream(
&self,
cx: &mut Context<'_>,
) -> Poll<Result<Stream, StreamStartError>>
pub fn poll_accept_inbound_stream( &self, cx: &mut Context<'_>, ) -> Poll<Result<Stream, StreamStartError>>
Poll to accept an inbound bidilectional stream.
Sourcepub fn accept_inbound_uni_stream(&self) -> AcceptInboundUniStream<'_> ⓘ
pub fn accept_inbound_uni_stream(&self) -> AcceptInboundUniStream<'_> ⓘ
Accept an inbound unidirectional stream.
Sourcepub fn poll_accept_inbound_uni_stream(
&self,
cx: &mut Context<'_>,
) -> Poll<Result<ReadStream, StreamStartError>>
pub fn poll_accept_inbound_uni_stream( &self, cx: &mut Context<'_>, ) -> Poll<Result<ReadStream, StreamStartError>>
Poll to accept an inbound unidirectional stream.
Sourcepub fn poll_receive_datagram(
&self,
cx: &mut Context<'_>,
) -> Poll<Result<Bytes, DgramReceiveError>>
pub fn poll_receive_datagram( &self, cx: &mut Context<'_>, ) -> Poll<Result<Bytes, DgramReceiveError>>
Poll to receive a datagram.
Sourcepub fn poll_send_datagram(
&self,
cx: &mut Context<'_>,
buf: &Bytes,
) -> Poll<Result<(), DgramSendError>>
pub fn poll_send_datagram( &self, cx: &mut Context<'_>, buf: &Bytes, ) -> Poll<Result<(), DgramSendError>>
Poll to send a datagram.
Sourcepub fn send_datagram(&self, buf: &Bytes) -> Result<(), DgramSendError>
pub fn send_datagram(&self, buf: &Bytes) -> Result<(), DgramSendError>
Send a datagram.
Sourcepub fn poll_shutdown(
&self,
cx: &mut Context<'_>,
error_code: u64,
) -> Poll<Result<(), ShutdownError>>
pub fn poll_shutdown( &self, cx: &mut Context<'_>, error_code: u64, ) -> Poll<Result<(), ShutdownError>>
Poll to shutdown the connection.
Sourcepub fn get_local_addr(&self) -> Result<SocketAddr, ConnectionError>
pub fn get_local_addr(&self) -> Result<SocketAddr, ConnectionError>
Get the local address of the connection.
Sourcepub fn get_remote_addr(&self) -> Result<SocketAddr, ConnectionError>
pub fn get_remote_addr(&self) -> Result<SocketAddr, ConnectionError>
Get the remote address of the connection.
Trait Implementations§
Source§impl Clone for Connection
impl Clone for Connection
Source§fn clone(&self) -> Connection
fn clone(&self) -> Connection
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for Connection
impl RefUnwindSafe for Connection
impl Send for Connection
impl Sync for Connection
impl Unpin for Connection
impl UnwindSafe for Connection
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