pub struct InboundOpaqueMessage<'a> {
pub typ: ContentType,
pub version: ProtocolVersion,
pub payload: BorrowedPayload<'a>,
}
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],
) -> Self
pub fn new( typ: ContentType, version: ProtocolVersion, payload: &'a mut [u8], ) -> Self
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_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> 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> !UnwindSafe for InboundOpaqueMessage<'a>
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
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 24 bytes