pub struct Connection { /* private fields */ }Implementations§
Source§impl Connection
impl Connection
Sourcepub async fn connect(
reg: &Registration,
config: &Configuration,
server_name: &str,
server_port: u16,
) -> Result<Self, Status>
pub async fn connect( reg: &Registration, config: &Configuration, server_name: &str, server_port: u16, ) -> Result<Self, Status>
Connects to the server Note: Registration must be kept outside of connection and must wait for all connections to finish before closing, else registration close will wait on system lock, and block rust runtime.
Sourcepub fn get_shutdown_waiter(&mut self) -> ConnectionShutdownWaiter
pub fn get_shutdown_waiter(&mut self) -> ConnectionShutdownWaiter
Can only be called once after construction.
Trait Implementations§
Source§impl<B: Buf> Connection<B> for Connection
Server accept streams
impl<B: Buf> Connection<B> for Connection
Server accept streams
Source§type RecvStream = H3RecvStream
type RecvStream = H3RecvStream
The type produced by
poll_accept_recv()Source§type OpenStreams = StreamOpener
type OpenStreams = StreamOpener
A producer of outgoing Unidirectional and Bidirectional streams.
Source§fn poll_accept_recv(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<Self::RecvStream, ConnectionErrorIncoming>>
fn poll_accept_recv( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<Self::RecvStream, ConnectionErrorIncoming>>
Accept an incoming unidirectional stream Read more
Source§fn poll_accept_bidi(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<Self::BidiStream, ConnectionErrorIncoming>>
fn poll_accept_bidi( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<Self::BidiStream, ConnectionErrorIncoming>>
Accept an incoming bidirectional stream Read more
Source§fn opener(&self) -> Self::OpenStreams
fn opener(&self) -> Self::OpenStreams
Get an object to open outgoing streams.
Source§impl Debug for Connection
impl Debug for Connection
Source§impl<B: Buf> OpenStreams<B> for Connection
bypass for StreamOpener
impl<B: Buf> OpenStreams<B> for Connection
bypass for StreamOpener
Source§type BidiStream = H3Stream
type BidiStream = H3Stream
The type produced by
poll_open_bidi()Source§type SendStream = H3SendStream
type SendStream = H3SendStream
The type produced by
poll_open_send()Source§fn poll_open_bidi(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<Self::BidiStream, StreamErrorIncoming>>
fn poll_open_bidi( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<Self::BidiStream, StreamErrorIncoming>>
Poll the connection to create a new bidirectional stream.
Source§fn poll_open_send(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<Self::SendStream, StreamErrorIncoming>>
fn poll_open_send( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<Self::SendStream, StreamErrorIncoming>>
Poll the connection to create a new unidirectional stream.
Auto Trait Implementations§
impl Freeze for Connection
impl !RefUnwindSafe for Connection
impl Send for Connection
impl Sync for Connection
impl Unpin for Connection
impl UnsafeUnpin 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