跳到主要内容

InboundOpaqueMessage

结构体 InboundOpaqueMessage 

Source
pub struct InboundOpaqueMessage<'a> {
    pub typ: ContentType,
    pub version: ProtocolVersion,
    pub payload: BorrowedPayload<'a>,
}
展开描述

A TLS frame, named TLSPlaintext in 标准.

This inbound type borrows its encrypted payload 从 缓冲区 elsewhere. It is 用 用于 joining 并 is 已消耗 by decryption.

字段§

§typ: ContentType§version: ProtocolVersion§payload: BorrowedPayload<'a>

实现§

Source§

impl<'a> InboundOpaqueMessage<'a>

Source

pub fn new( typ: ContentType, version: ProtocolVersion, payload: &'a mut [u8], ) -> Self

Construct 新 InboundOpaqueMessage 从 constituent fields.

payload 是借用的。

Source

pub fn into_plain_message(self) -> InboundPlainMessage<'a>

强制转换为明文消息

This should only be 用 用于 messages that are known 到 be in 明文. Otherwise, the InboundOpaqueMessage should be decrypted into 一个 PlainMessage using 一个 MessageDecrypter

Source

pub fn into_plain_message_range( self, range: Range<usize>, ) -> InboundPlainMessage<'a>

强制转换为明文消息

range restricts the resulting message: 此函数 panics if it is out of range 用于 底层 message payload.

This should only be 用 用于 messages that are known 到 be in 明文. Otherwise, the InboundOpaqueMessage should be decrypted into 一个 PlainMessage using 一个 MessageDecrypter

Source

pub fn into_tls13_unpadded_message( self, ) -> Result<InboundPlainMessage<'a>, Error>

For TLS 1.3 (only), checks the length msg.payload is valid 并 removes the padding.

Returns an error if the message (pre-unpadding) is too long, 或 the padding is invalid, 或 the message (post-unpadding) is too long.

自动 Trait 实现§

Blanket 实现§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. 更多信息
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows 从 an owned value. 更多信息
Source§

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

Source§

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

Mutably borrows 从 an owned value. 更多信息
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

原样返回传入的参数。

Source§

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

Source§

fn into(self) -> U

Calls U::从(self)

That is, this conversion is whatever the implementation of From<T> 用于 U 的实现方式。

Source§

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

Source§

type Error = Infallible

转换出错时返回的类型。
Source§

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

执行转换。
Source§

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

Source§

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

转换出错时返回的类型。
Source§

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

执行转换。