Struct routing::ImmutableData [−][src]
pub struct ImmutableData { /* fields omitted */ }
An immutable chunk of data.
Note that the name
member is omitted when serialising ImmutableData
and is calculated from
the value
when deserialising.
Methods
impl ImmutableData
[src]
impl ImmutableData
pub fn new(value: Vec<u8>) -> ImmutableData
[src]
pub fn new(value: Vec<u8>) -> ImmutableData
Creates a new instance of ImmutableData
pub fn value(&self) -> &Vec<u8>
[src]
pub fn value(&self) -> &Vec<u8>
Returns the value
pub fn name(&self) -> &XorName
[src]
pub fn name(&self) -> &XorName
Returns name ensuring invariant.
pub fn payload_size(&self) -> usize
[src]
pub fn payload_size(&self) -> usize
Returns size of contained value.
pub fn serialised_size(&self) -> u64
[src]
pub fn serialised_size(&self) -> u64
Returns size of this data after serialisation.
pub fn validate_size(&self) -> bool
[src]
pub fn validate_size(&self) -> bool
Return true if the size is valid
Trait Implementations
impl Hash for ImmutableData
[src]
impl Hash for ImmutableData
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Clone for ImmutableData
[src]
impl Clone for ImmutableData
fn clone(&self) -> ImmutableData
[src]
fn clone(&self) -> ImmutableData
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Eq for ImmutableData
[src]
impl Eq for ImmutableData
impl PartialEq for ImmutableData
[src]
impl PartialEq for ImmutableData
fn eq(&self, other: &ImmutableData) -> bool
[src]
fn eq(&self, other: &ImmutableData) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &ImmutableData) -> bool
[src]
fn ne(&self, other: &ImmutableData) -> bool
This method tests for !=
.
impl Ord for ImmutableData
[src]
impl Ord for ImmutableData
fn cmp(&self, other: &ImmutableData) -> Ordering
[src]
fn cmp(&self, other: &ImmutableData) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl PartialOrd for ImmutableData
[src]
impl PartialOrd for ImmutableData
fn partial_cmp(&self, other: &ImmutableData) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &ImmutableData) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &ImmutableData) -> bool
[src]
fn lt(&self, other: &ImmutableData) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &ImmutableData) -> bool
[src]
fn le(&self, other: &ImmutableData) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &ImmutableData) -> bool
[src]
fn gt(&self, other: &ImmutableData) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &ImmutableData) -> bool
[src]
fn ge(&self, other: &ImmutableData) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Serialize for ImmutableData
[src]
impl Serialize for ImmutableData
fn serialize<S: Serializer>(&self, serialiser: S) -> Result<S::Ok, S::Error>
[src]
fn serialize<S: Serializer>(&self, serialiser: S) -> Result<S::Ok, S::Error>
Serialize this value into the given Serde serializer. Read more
impl<'de> Deserialize<'de> for ImmutableData
[src]
impl<'de> Deserialize<'de> for ImmutableData
fn deserialize<D: Deserializer<'de>>(
deserializer: D
) -> Result<ImmutableData, D::Error>
[src]
fn deserialize<D: Deserializer<'de>>(
deserializer: D
) -> Result<ImmutableData, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl Debug for ImmutableData
[src]
impl Debug for ImmutableData
Auto Trait Implementations
impl Send for ImmutableData
impl Send for ImmutableData
impl Sync for ImmutableData
impl Sync for ImmutableData