pub struct Message {
pub typ: ContentType,
pub version: ProtocolVersion,
pub payload: MessagePayload,
}
Expand description
A TLS frame, named TLSPlaintext in the standard. This type owns all memory for its interior parts.
Fields
typ: ContentType
version: ProtocolVersion
payload: MessagePayload
Implementations
sourceimpl Message
impl Message
sourcepub const MAX_WIRE_SIZE: usize = 18_437usize
pub const MAX_WIRE_SIZE: usize = 18_437usize
Maximum on-wire message size.
sourceimpl Message
impl Message
sourcepub fn read_with_detailed_error(
r: &mut Reader<'_>
) -> Result<Message, MessageError>
pub fn read_with_detailed_error(
r: &mut Reader<'_>
) -> Result<Message, MessageError>
Like Message::read(), but allows the important distinction between: this message might be valid if we read more data; and this message will never be valid.
pub fn is_content_type(&self, typ: ContentType) -> bool
pub fn is_handshake_type(&self, hstyp: HandshakeType) -> bool
pub fn decode_payload(&mut self) -> bool
pub fn take_payload(self) -> Vec<u8>
pub fn take_opaque_payload(&mut self) -> Option<Payload>
pub fn into_opaque(self) -> Message
pub fn build_alert(level: AlertLevel, desc: AlertDescription) -> Message
pub fn build_key_update_notify() -> Message
sourceimpl<'a> Message
impl<'a> Message
pub fn to_borrowed(&'a self) -> BorrowMessage<'a>
Trait Implementations
sourceimpl Codec for Message
impl Codec for Message
sourcefn read(r: &mut Reader<'_>) -> Option<Message>
fn read(r: &mut Reader<'_>) -> Option<Message>
Decode yourself by fiddling with the Reader
.
Return Some if it worked, None if not. Read more
sourcefn get_encoding(&self) -> Vec<u8>
fn get_encoding(&self) -> Vec<u8>
Convenience function to get the results of encode()
.
sourcefn read_bytes(bytes: &[u8]) -> Option<Self>
fn read_bytes(bytes: &[u8]) -> Option<Self>
Read one of these from the front of bytes
and
return it. Read more
Auto Trait Implementations
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnwindSafe for Message
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