pub struct InboundOpaqueMessage<'a> {
pub typ: ContentType,
pub version: ProtocolVersion,
pub payload: BorrowedPayload<'a>,
}websocket only.Expand description
A TLS frame, named TLSPlaintext in the standard.
This inbound type borrows its encrypted payload from a buffer elsewhere. It is used for joining and is consumed by decryption.
Fields§
§typ: ContentType§version: ProtocolVersion§payload: BorrowedPayload<'a>Implementations§
Source§impl<'a> InboundOpaqueMessage<'a>
impl<'a> InboundOpaqueMessage<'a>
Sourcepub fn new(
typ: ContentType,
version: ProtocolVersion,
payload: &'a mut [u8],
) -> InboundOpaqueMessage<'a>
pub fn new( typ: ContentType, version: ProtocolVersion, payload: &'a mut [u8], ) -> InboundOpaqueMessage<'a>
Construct a new InboundOpaqueMessage from constituent fields.
payload is borrowed.
Sourcepub fn into_plain_message(self) -> InboundPlainMessage<'a>
pub fn into_plain_message(self) -> InboundPlainMessage<'a>
Force conversion into a plaintext message.
This should only be used for messages that are known to be in plaintext. Otherwise, the
InboundOpaqueMessage should be decrypted into a PlainMessage using a MessageDecrypter.
Sourcepub fn into_plain_message_range(
self,
range: Range<usize>,
) -> InboundPlainMessage<'a>
pub fn into_plain_message_range( self, range: Range<usize>, ) -> InboundPlainMessage<'a>
Force conversion into a plaintext message.
range restricts the resulting message: this function panics if it is out of range for
the underlying message payload.
This should only be used for messages that are known to be in plaintext. Otherwise, the
InboundOpaqueMessage should be decrypted into a PlainMessage using a MessageDecrypter.
Sourcepub fn into_tls13_unpadded_message(
self,
) -> Result<InboundPlainMessage<'a>, Error>
pub fn into_tls13_unpadded_message( self, ) -> Result<InboundPlainMessage<'a>, Error>
For TLS1.3 (only), checks the length msg.payload is valid and removes the padding.
Returns an error if the message (pre-unpadding) is too long, or the padding is invalid, or the message (post-unpadding) is too long.
Auto Trait Implementations§
impl<'a> !UnwindSafe for InboundOpaqueMessage<'a>
impl<'a> Freeze for InboundOpaqueMessage<'a>
impl<'a> RefUnwindSafe for InboundOpaqueMessage<'a>
impl<'a> Send for InboundOpaqueMessage<'a>
impl<'a> Sync for InboundOpaqueMessage<'a>
impl<'a> Unpin for InboundOpaqueMessage<'a>
impl<'a> UnsafeUnpin for InboundOpaqueMessage<'a>
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<T, U> Captures<U> for Twhere
T: ?Sized,
impl<T> Channel for T
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
impl<T> ConditionalSend for Twhere
T: Send,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
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>
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>
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