rustls::msgs::message::inbound

Struct InboundPlainMessage

Source
pub struct InboundPlainMessage<'a> {
    pub typ: ContentType,
    pub version: ProtocolVersion,
    pub payload: &'a [u8],
}
Expand description

A TLS frame, named TLSPlaintext in the standard.

This inbound type borrows its decrypted payload from the original buffer. It results from decryption.

Fields§

§typ: ContentType§version: ProtocolVersion§payload: &'a [u8]

Implementations§

Source§

impl InboundPlainMessage<'_>

Source

pub(crate) fn is_valid_ccs(&self) -> bool

Returns true if the payload is a CCS message.

We passthrough ChangeCipherSpec messages in the deframer without decrypting them. Note: this is prior to the record layer, so is unencrypted. See third paragraph of section 5 in RFC8446.

Trait Implementations§

Source§

impl<'a> Debug for InboundPlainMessage<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> TryFrom<InboundPlainMessage<'a>> for Message<'a>

Parses a plaintext message into a well-typed Message.

A PlainMessage must contain plaintext content. Encrypted content should be stored in an InboundOpaqueMessage and decrypted before being stored into a PlainMessage.

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(plain: InboundPlainMessage<'a>) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.