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§
source§impl 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
source§impl<'a> Message
impl<'a> Message
pub fn to_borrowed(&'a self) -> BorrowMessage<'a>
Trait Implementations§
source§impl Codec for Message
impl Codec for Message
source§fn 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.source§fn get_encoding(&self) -> Vec<u8>
fn get_encoding(&self) -> Vec<u8>
Convenience function to get the results of
encode()
.source§fn 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.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§
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