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
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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: 32 bytes