pub struct Session {
pub datagrams: Datagrams,
pub close_on_drop: bool,
/* private fields */
}
Expand description
Session holds the web_wt_sys::WebTransport
and is responsible for
providing access to the Web API of WebTransport in a way that is portable.
It also holds handles to the datagram reader and writer, as well as
the datagram reader state.
Fields§
§datagrams: Datagrams
The datagrams state for this session.
close_on_drop: bool
Whether to close the session on drop.
Implementations§
Source§impl Session
impl Session
Sourcepub fn new(transport: WebTransport) -> Self
pub fn new(transport: WebTransport) -> Self
Construct a new session from a web_wt_sys::WebTransport
.
Sourcepub fn try_unwrap(self) -> Result<WebTransport, Self>
pub fn try_unwrap(self) -> Result<WebTransport, Self>
If possible, relieves the underlying web_wt_sys::WebTransport
of
any xwt-web
-held locks and dependencies and exposes it.
Sourcepub const fn transport_ref(&self) -> &Rc<WebTransport>
pub const fn transport_ref(&self) -> &Rc<WebTransport>
Obtain a transport ref.
Trait Implementations§
Source§impl AcceptUni for Session
impl AcceptUni for Session
type Error = Error
async fn accept_uni(&self) -> Result<Self::RecvStream, Self::Error>
Source§impl ReceiveInto for Session
impl ReceiveInto for Session
Source§impl RecvSpec for Session
impl RecvSpec for Session
type RecvStream = RecvStream
Source§impl SendSpec for Session
impl SendSpec for Session
type SendStream = SendStream
Auto Trait Implementations§
impl !Freeze for Session
impl !RefUnwindSafe for Session
impl !Send for Session
impl !Sync for Session
impl Unpin for Session
impl UnwindSafe for Session
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