Skip to main content

Connection

Struct Connection 

Source
pub struct Connection { /* private fields */ }

Implementations§

Source§

impl Connection

Source

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.

Source

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

Source§

type RecvStream = H3RecvStream

The type produced by poll_accept_recv()
Source§

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>>

Accept an incoming unidirectional stream Read more
Source§

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

Get an object to open outgoing streams.
Source§

impl Debug for Connection

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<B: Buf> OpenStreams<B> for Connection

bypass for StreamOpener

Source§

type BidiStream = H3Stream

The type produced by poll_open_bidi()
Source§

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>>

Poll the connection to create a new bidirectional stream.
Source§

fn poll_open_send( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<Self::SendStream, StreamErrorIncoming>>

Poll the connection to create a new unidirectional stream.
Source§

fn close(&mut self, code: Code, reason: &[u8])

Close the connection immediately

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.