Session

Struct Session 

Source
#[repr(transparent)]
pub struct Session<T>(pub T);
Expand description

A WebTransport session.

Tuple Fields§

§0: T

Implementations§

Source§

impl<T> Session<T>

Source

pub const fn from_const(value: T) -> Self

Create an instance from a value of the underlying type T with a const context.

Source

pub fn into_inner(self) -> T

Take the underlying value out.

Source

pub const fn inner_ref(&self) -> &T

Take a ref to the underlying value.

Source

pub fn inner_mut(&mut self) -> &mut T

Take a mut ref to the underlying value.

Trait Implementations§

Source§

impl<T> AcceptBi for Session<T>
where T: AcceptBi + Send + Sync,

Source§

type Error = <T as AcceptBi>::Error

Source§

async fn accept_bi(&self) -> Result<TupleFor<Self>, Self::Error>

Source§

impl<T> AcceptUni for Session<T>
where T: AcceptUni + Send + Sync,

Source§

type Error = <T as AcceptUni>::Error

Source§

async fn accept_uni(&self) -> Result<Self::RecvStream, Self::Error>

Source§

impl<T> AsMut<T> for Session<T>

Source§

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

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl<T> AsRef<T> for Session<T>

Source§

fn as_ref(&self) -> &T

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<T> Deref for Session<T>

Source§

type Target = T

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<T> DerefMut for Session<T>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl<T> From<T> for Session<T>

Source§

fn from(value: T) -> Self

Converts to this type from the input type.
Source§

impl<T> MaxSize for Session<T>
where T: MaxSize + Send + Sync,

Source§

fn max_datagram_size(&self) -> Option<usize>

Gets the maximum byte length that a user-sent datagram is allowed to be. Read more
Source§

impl<T> OpenBi for Session<T>
where T: OpenBi + Send + Sync,

Source§

type Opening = OpeningBiStream<<T as OpenBi>::Opening>

Source§

type Error = <T as OpenBi>::Error

Source§

async fn open_bi(&self) -> Result<Self::Opening, Self::Error>

Source§

impl<T> OpenUni for Session<T>
where T: OpenUni + Send + Sync,

Source§

type Opening = OpeningUniStream<<T as OpenUni>::Opening>

Source§

type Error = <T as OpenUni>::Error

Source§

async fn open_uni(&self) -> Result<Self::Opening, Self::Error>

Source§

impl<T> Receive for Session<T>
where T: Receive + Send + Sync,

Source§

type Datagram = Datagram<<T as Receive>::Datagram>

Source§

type Error = <T as Receive>::Error

Source§

async fn receive_datagram(&self) -> Result<Self::Datagram, Self::Error>

Source§

impl<T> ReceiveInto for Session<T>
where T: ReceiveInto + Send + Sync,

Source§

type Error = <T as ReceiveInto>::Error

Source§

async fn receive_datagram_into( &self, buf: &mut [u8], ) -> Result<usize, Self::Error>

Source§

impl<T> RecvSpec for Session<T>
where T: RecvSpec,

Source§

impl<T> Send for Session<T>
where T: Send + Send + Sync,

Source§

type Error = <T as Send>::Error

Source§

async fn send_datagram<D>(&self, payload: D) -> Result<(), Self::Error>
where D: Send + AsRef<[u8]>,

Source§

impl<T> SendSpec for Session<T>
where T: SendSpec,

Auto Trait Implementations§

§

impl<T> Freeze for Session<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for Session<T>
where T: RefUnwindSafe,

§

impl<T> Send for Session<T>
where T: Send,

§

impl<T> Sync for Session<T>
where T: Sync,

§

impl<T> Unpin for Session<T>
where T: Unpin,

§

impl<T> UnwindSafe for Session<T>
where T: UnwindSafe,

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<!> for T

Source§

fn from(t: !) -> T

Converts to this type from the input type.
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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.
Source§

impl<T> Connection for T
where T: Session,

Source§

impl<T> DatagramOps for T
where T: Send + MaxSize + Send + Receive + ReceiveInto,

Source§

impl<T> PairSpec for T
where T: Send + SendSpec + RecvSpec,

Source§

impl<T> Send for T
where T: Send,

Source§

impl<T> Session for T

Source§

impl<T> StreamOps for T

Source§

impl<T> Sync for T
where T: Sync,