Struct s2n_quic_transport::connection::Connection
source · pub struct Connection { /* private fields */ }
Expand description
A QUIC connection
Implementations§
source§impl Connection
impl Connection
sourcepub fn poll_accept(
&mut self,
stream_type: Option<StreamType>,
context: &Context<'_>
) -> Poll<Result<Option<Stream>, Error>>
pub fn poll_accept( &mut self, stream_type: Option<StreamType>, context: &Context<'_> ) -> Poll<Result<Option<Stream>, Error>>
Accepts an incoming Stream
The method will return
Poll::Ready(Ok(Some(stream, stream_type)))
if aStream
was acceptedPoll::Ready(Ok(None))
if the connection was closed without an errorPoll::Ready(Err(stream_error))
if no stream could be accepted due to an errorPoll::Pending
if no newStream
of the given type was accepted by the connection yet. In this case the caller must retry callingSelf::poll_accept
. For this purpose the method will save thecore::task::Waker
which is provided as part of theContext
parameter, and notify it as soon as retrying the method will yield a different result.
pub fn poll_open_stream( &mut self, stream_type: StreamType, context: &Context<'_> ) -> Poll<Result<Stream, Error>>
pub fn poll_request( &self, stream_id: StreamId, request: &mut Request<'_>, context: Option<&Context<'_>> ) -> Result<Response, StreamError>
sourcepub fn close(&self, error_code: Error)
pub fn close(&self, error_code: Error)
Closes the Connection with the provided error code
This will immediately terminate all outstanding streams.
pub fn server_name(&self) -> Result<Option<ServerName>, Error>
pub fn application_protocol(&self) -> Result<Bytes, Error>
pub fn id(&self) -> u64
pub fn ping(&self) -> Result<(), Error>
pub fn keep_alive(&self, enabled: bool) -> Result<(), Error>
pub fn local_address(&self) -> Result<SocketAddress, Error>
pub fn remote_address(&self) -> Result<SocketAddress, Error>
pub fn query_event_context(&self, query: &mut dyn Query) -> Result<(), Error>
pub fn query_event_context_mut( &self, query: &mut dyn QueryMut ) -> Result<(), Error>
pub fn datagram_mut(&self, query: &mut dyn QueryMut) -> Result<(), Error>
Trait Implementations§
source§impl Clone for Connection
impl Clone for Connection
source§impl Debug for Connection
impl Debug for Connection
Auto 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