pub enum PeerRecvStream {
Plain(RecvStream),
Encrypted(CryptoRecvStream),
Prefixed {
prefix: VecDeque<u8>,
inner: Box<PeerRecvStream>,
},
}Variants§
Plain(RecvStream)
Encrypted(CryptoRecvStream)
Prefixed
Plaintext bytes read by a host-side protocol classifier, followed by the original protected stream. This lets one native host inspect a channel envelope without stealing or duplicating the admitted-stream queue.
Implementations§
Source§impl PeerRecvStream
impl PeerRecvStream
pub fn plain(inner: RecvStream) -> Self
pub fn encrypted(inner: RecvStream, key: [u8; 32]) -> Result<Self>
pub fn encrypted_with_prefix( inner: RecvStream, key: [u8; 32], prefix: &[u8], ) -> Result<Self>
pub fn is_encrypted(&self) -> bool
Sourcepub fn with_plaintext_prefix(self, prefix: impl IntoIterator<Item = u8>) -> Self
pub fn with_plaintext_prefix(self, prefix: impl IntoIterator<Item = u8>) -> Self
Restore plaintext consumed during bounded host-side classification.
pub async fn read(&mut self, buf: &mut [u8]) -> Result<usize>
pub fn into_plain(self) -> RecvStream
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for PeerRecvStream
impl !UnwindSafe for PeerRecvStream
impl Freeze for PeerRecvStream
impl Send for PeerRecvStream
impl Sync for PeerRecvStream
impl Unpin for PeerRecvStream
impl UnsafeUnpin for PeerRecvStream
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
Converts
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> ⓘ
Converts
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