pub struct Stream<S: Session, V> {
pub writer: Writer<S::SendStream, V>,
pub reader: Reader<S::RecvStream, V>,
}Fields§
§writer: Writer<S::SendStream, V>§reader: Reader<S::RecvStream, V>Implementations§
Source§impl<S: Session, V> Stream<S, V>
impl<S: Session, V> Stream<S, V>
Sourcepub async fn open(session: &S, version: V) -> Result<Self, Error>where
V: Clone,
pub async fn open(session: &S, version: V) -> Result<Self, Error>where
V: Clone,
Open a new stream with the given version.
Sourcepub async fn accept(session: &S, version: V) -> Result<Self, Error>where
V: Clone,
pub async fn accept(session: &S, version: V) -> Result<Self, Error>where
V: Clone,
Accept a new stream with the given version.
Sourcepub fn with_version<O: Clone>(self, version: O) -> Stream<S, O>
pub fn with_version<O: Clone>(self, version: O) -> Stream<S, O>
Cast the stream to a different version, used during version negotiation.
Auto Trait Implementations§
impl<S, V> Freeze for Stream<S, V>
impl<S, V> RefUnwindSafe for Stream<S, V>where
V: RefUnwindSafe,
<S as Session>::RecvStream: RefUnwindSafe,
<S as Session>::SendStream: RefUnwindSafe,
impl<S, V> Send for Stream<S, V>where
V: Send,
impl<S, V> Sync for Stream<S, V>
impl<S, V> Unpin for Stream<S, V>
impl<S, V> UnwindSafe for Stream<S, V>where
V: UnwindSafe,
<S as Session>::RecvStream: UnwindSafe,
<S as Session>::SendStream: UnwindSafe,
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