pub struct ConnectionInner<C, B>where
C: Connection<B>,
B: Buf,{
pub shared: Arc<SharedState>,
pub conn: C,
pub send_grease_frame: bool,
pub config: Config,
/* private fields */
}h3 only.Fields§
§conn: CTODO: breaking encapsulation just to see if we can get this to work, will fix before merging
send_grease_frame: bool§config: ConfigImplementations§
Source§impl<C, B> ConnectionInner<C, B>where
C: Connection<B>,
B: Buf,
This trait is implemented for all types which can close the connection
impl<C, B> ConnectionInner<C, B>where
C: Connection<B>,
B: Buf,
This trait is implemented for all types which can close the connection
Sourcepub fn handle_connection_error<T>(&mut self, error: T) -> ConnectionErrorwhere
T: Into<ErrorOrigin>,
pub fn handle_connection_error<T>(&mut self, error: T) -> ConnectionErrorwhere
T: Into<ErrorOrigin>,
Handle errors on the connection, closes the connection if needed
This can be a ConnectionErrorIncoming or a InternalConnectionError
Sourcepub fn poll_connection_error(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<(), ConnectionError>>
pub fn poll_connection_error( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<(), ConnectionError>>
Polls for the connection error
Returns an Result to allow using ? in the calling function
Sourcepub fn close_connection(&mut self, code: Code, reason: String)
pub fn close_connection(&mut self, code: Code, reason: String)
Close the connection
Source§impl<B, C> ConnectionInner<C, B>where
C: Connection<B>,
B: Buf,
impl<B, C> ConnectionInner<C, B>where
C: Connection<B>,
B: Buf,
Sourcepub async fn send_control_stream_headers(
&mut self,
) -> Result<(), ConnectionError>
pub async fn send_control_stream_headers( &mut self, ) -> Result<(), ConnectionError>
Sends the settings and initializes the control streams
Sourcepub async fn new(
conn: C,
shared: Arc<SharedState>,
config: Config,
) -> Result<ConnectionInner<C, B>, ConnectionError>
pub async fn new( conn: C, shared: Arc<SharedState>, config: Config, ) -> Result<ConnectionInner<C, B>, ConnectionError>
Initiates the connection and opens a control stream
Sourcepub async fn shutdown<T>(
&mut self,
sent_closing: &mut Option<T>,
max_id: T,
) -> Result<(), ConnectionError>
pub async fn shutdown<T>( &mut self, sent_closing: &mut Option<T>, max_id: T, ) -> Result<(), ConnectionError>
Send GOAWAY with specified max_id, iff max_id is smaller than the previous one.
pub fn poll_accept_bi( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<<C as OpenStreams<B>>::BidiStream, ConnectionError>>
Sourcepub fn poll_accept_recv(
&mut self,
cx: &mut Context<'_>,
) -> Result<(), ConnectionError>
pub fn poll_accept_recv( &mut self, cx: &mut Context<'_>, ) -> Result<(), ConnectionError>
Polls incoming streams
Accepted streams which are not control, decoder, or encoder streams are buffer in accepted_recv_streams
Sourcepub fn poll_control(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<Frame<PayloadLen>, ConnectionError>>
pub fn poll_control( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<Frame<PayloadLen>, ConnectionError>>
Waits for the control stream to be received and reads subsequent frames.
pub fn accepted_streams_mut(&mut self) -> &mut AcceptedStreams<C, B>
Trait Implementations§
Source§impl<B, C> ConnectionState for ConnectionInner<C, B>where
C: Connection<B>,
B: Buf,
impl<B, C> ConnectionState for ConnectionInner<C, B>where
C: Connection<B>,
B: Buf,
Source§fn get_conn_error(&self) -> Option<ErrorOrigin>
fn get_conn_error(&self) -> Option<ErrorOrigin>
Source§fn set_conn_error(&self, error: ErrorOrigin) -> ErrorOrigin
fn set_conn_error(&self, error: ErrorOrigin) -> ErrorOrigin
Source§fn set_conn_error_and_wake<T>(&self, error: T) -> ErrorOriginwhere
T: Into<ErrorOrigin>,
fn set_conn_error_and_wake<T>(&self, error: T) -> ErrorOriginwhere
T: Into<ErrorOrigin>,
Source§fn set_closing(&self)
fn set_closing(&self)
Source§fn is_closing(&self) -> bool
fn is_closing(&self) -> bool
Source§fn set_settings(&self, settings: Settings)
fn set_settings(&self, settings: Settings)
Source§fn waker(&self) -> &AtomicWaker
fn waker(&self) -> &AtomicWaker
Auto Trait Implementations§
impl<C, B> Freeze for ConnectionInner<C, B>where
C: Freeze,
<C as OpenStreams<B>>::SendStream: Freeze,
<C as Connection<B>>::RecvStream: Freeze,
impl<C, B> !RefUnwindSafe for ConnectionInner<C, B>
impl<C, B> Send for ConnectionInner<C, B>where
C: Send,
<C as OpenStreams<B>>::SendStream: Send,
B: Send,
<C as Connection<B>>::RecvStream: Send,
impl<C, B> Sync for ConnectionInner<C, B>where
C: Sync,
<C as OpenStreams<B>>::SendStream: Sync,
B: Sync,
<C as Connection<B>>::RecvStream: Sync,
impl<C, B> Unpin for ConnectionInner<C, B>
impl<C, B> !UnwindSafe for ConnectionInner<C, B>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more