pub struct OpaqueMessage {
pub typ: ContentType,
pub version: ProtocolVersion,
pub payload: Payload,
}
Expand description
A TLS frame, named TLSPlaintext in the standard.
This type owns all memory for its interior parts. It is used to read/write from/to I/O
buffers as well as for fragmenting, joining and encryption/decryption. It can be converted
into a Message
by decoding the payload.
Fields
typ: ContentType
version: ProtocolVersion
payload: Payload
Implementations
sourceimpl OpaqueMessage
impl OpaqueMessage
sourcepub fn read(r: &mut Reader<'_>) -> Result<Self, MessageError>
pub fn read(r: &mut Reader<'_>) -> Result<Self, MessageError>
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
OpaqueMessage
should be decrypted into a PlainMessage
using a MessageDecrypter
.
sourcepub const MAX_WIRE_SIZE: usize
pub const MAX_WIRE_SIZE: usize
Maximum on-wire message size.
Trait Implementations
sourceimpl Clone for OpaqueMessage
impl Clone for OpaqueMessage
sourcefn clone(&self) -> OpaqueMessage
fn clone(&self) -> OpaqueMessage
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl RefUnwindSafe for OpaqueMessage
impl Send for OpaqueMessage
impl Sync for OpaqueMessage
impl Unpin for OpaqueMessage
impl UnwindSafe for OpaqueMessage
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more