Struct mls_rs::ProtocolVersion
source · pub struct ProtocolVersion(/* private fields */);
Expand description
Wrapper type representing a protocol version identifier.
Implementations§
source§impl ProtocolVersion
impl ProtocolVersion
sourcepub const MLS_10: ProtocolVersion = _
pub const MLS_10: ProtocolVersion = _
MLS version 1.0
sourcepub const fn new(value: u16) -> ProtocolVersion
pub const fn new(value: u16) -> ProtocolVersion
Protocol version from a raw value, useful for testing.
sourcepub fn all() -> impl Iterator<Item = ProtocolVersion>
pub fn all() -> impl Iterator<Item = ProtocolVersion>
An iterator over all of the defined MLS versions.
Methods from Deref<Target = u16>§
pub const MIN: u16 = 0u16
pub const MAX: u16 = 65_535u16
pub const BITS: u32 = 16u32
Trait Implementations§
source§impl Clone for ProtocolVersion
impl Clone for ProtocolVersion
source§fn clone(&self) -> ProtocolVersion
fn clone(&self) -> ProtocolVersion
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ProtocolVersion
impl Debug for ProtocolVersion
source§impl Deref for ProtocolVersion
impl Deref for ProtocolVersion
source§impl From<ProtocolVersion> for u16
impl From<ProtocolVersion> for u16
source§fn from(value: ProtocolVersion) -> u16
fn from(value: ProtocolVersion) -> u16
Converts to this type from the input type.
source§impl From<u16> for ProtocolVersion
impl From<u16> for ProtocolVersion
source§fn from(value: u16) -> ProtocolVersion
fn from(value: u16) -> ProtocolVersion
Converts to this type from the input type.
source§impl Hash for ProtocolVersion
impl Hash for ProtocolVersion
source§impl MlsDecode for ProtocolVersion
impl MlsDecode for ProtocolVersion
fn mls_decode(reader: &mut &[u8]) -> Result<ProtocolVersion, Error>
source§impl MlsEncode for ProtocolVersion
impl MlsEncode for ProtocolVersion
source§impl MlsSize for ProtocolVersion
impl MlsSize for ProtocolVersion
fn mls_encoded_len(&self) -> usize
source§impl Ord for ProtocolVersion
impl Ord for ProtocolVersion
source§fn cmp(&self, other: &ProtocolVersion) -> Ordering
fn cmp(&self, other: &ProtocolVersion) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for ProtocolVersion
impl PartialEq for ProtocolVersion
source§fn eq(&self, other: &ProtocolVersion) -> bool
fn eq(&self, other: &ProtocolVersion) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for ProtocolVersion
impl PartialOrd for ProtocolVersion
source§fn partial_cmp(&self, other: &ProtocolVersion) -> Option<Ordering>
fn partial_cmp(&self, other: &ProtocolVersion) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for ProtocolVersion
impl Eq for ProtocolVersion
impl StructuralPartialEq for ProtocolVersion
Auto Trait Implementations§
impl Freeze for ProtocolVersion
impl RefUnwindSafe for ProtocolVersion
impl Send for ProtocolVersion
impl Sync for ProtocolVersion
impl Unpin for ProtocolVersion
impl UnwindSafe for ProtocolVersion
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