Enum ContentType
pub enum ContentType {
ChangeCipherSpec,
Alert,
Handshake,
ApplicationData,
Heartbeat,
Unknown(u8),
}
Expand description
The ContentType
TLS protocol enum.
Values in this enum are taken
from the various RFCs covering TLS, and are listed by IANA.
The Unknown
item is used when processing unrecognised ordinals.
Variants§
Implementations§
§impl ContentType
impl ContentType
pub fn get_u8(&self) -> u8
Trait Implementations§
§impl Clone for ContentType
impl Clone for ContentType
§fn clone(&self) -> ContentType
fn clone(&self) -> ContentType
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§impl Codec for ContentType
impl Codec for ContentType
§fn read(r: &mut Reader<'_>) -> Option<ContentType>
fn read(r: &mut Reader<'_>) -> Option<ContentType>
Decode yourself by fiddling with the
Reader
.
Return Some if it worked, None if not.§fn get_encoding(&self) -> Vec<u8> ⓘ
fn get_encoding(&self) -> Vec<u8> ⓘ
Convenience function to get the results of
encode()
.§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.§impl Debug for ContentType
impl Debug for ContentType
§impl<'de> Deserialize<'de> for ContentType
impl<'de> Deserialize<'de> for ContentType
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ContentType, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ContentType, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl From<u8> for ContentType
impl From<u8> for ContentType
§fn from(x: u8) -> ContentType
fn from(x: u8) -> ContentType
Converts to this type from the input type.
§impl PartialEq for ContentType
impl PartialEq for ContentType
§fn eq(&self, other: &ContentType) -> bool
fn eq(&self, other: &ContentType) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.§impl Serialize for ContentType
impl Serialize for ContentType
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for ContentType
impl Eq for ContentType
impl StructuralPartialEq for ContentType
Auto Trait Implementations§
impl Freeze for ContentType
impl RefUnwindSafe for ContentType
impl Send for ContentType
impl Sync for ContentType
impl Unpin for ContentType
impl UnwindSafe for ContentType
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)