Struct rustls::crypto::cipher::OutboundOpaqueMessage
source · pub struct OutboundOpaqueMessage {
pub typ: ContentType,
pub version: ProtocolVersion,
pub payload: PrefixedPayload,
}
Expand description
A TLS frame, named TLSPlaintext
in the standard.
This outbound type owns all memory for its interior parts. It results from encryption and is used for io write.
Fields§
§typ: ContentType
§version: ProtocolVersion
§payload: PrefixedPayload
Implementations§
source§impl OutboundOpaqueMessage
impl OutboundOpaqueMessage
sourcepub fn new(
typ: ContentType,
version: ProtocolVersion,
payload: PrefixedPayload,
) -> Self
pub fn new( typ: ContentType, version: ProtocolVersion, payload: PrefixedPayload, ) -> Self
Construct a new OpaqueMessage
from constituent fields.
body
is moved into the payload
field.
sourcepub fn read(r: &mut Reader<'_>) -> Result<Self, MessageError>
pub fn read(r: &mut Reader<'_>) -> Result<Self, MessageError>
Construct by decoding from a [Reader
].
MessageError
allows callers to distinguish between valid prefixes (might
become valid if we read more data) and invalid data.
pub fn encode(self) -> Vec<u8>
sourcepub fn into_plain_message(self) -> PlainMessage
pub fn into_plain_message(self) -> PlainMessage
Force conversion into a plaintext message.
This should only be used for messages that are known to be in plaintext. Otherwise, the
OutboundOpaqueMessage
should be decrypted into a PlainMessage
using a MessageDecrypter
.
Trait Implementations§
source§impl Clone for OutboundOpaqueMessage
impl Clone for OutboundOpaqueMessage
source§fn clone(&self) -> OutboundOpaqueMessage
fn clone(&self) -> OutboundOpaqueMessage
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for OutboundOpaqueMessage
impl RefUnwindSafe for OutboundOpaqueMessage
impl Send for OutboundOpaqueMessage
impl Sync for OutboundOpaqueMessage
impl Unpin for OutboundOpaqueMessage
impl UnwindSafe for OutboundOpaqueMessage
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)