Struct routing::MessageId [−][src]
pub struct MessageId(_);
Unique ID for messages
This is used for deduplication: Since the network sends messages redundantly along different routes, the same message will usually arrive more than once at any given node. A message with an ID that is already in the cache will be ignored.
Methods
impl MessageId
[src]
impl MessageId
pub fn new() -> MessageId
[src]
pub fn new() -> MessageId
Generate a new MessageId
with random content.
pub fn zero() -> MessageId
[src]
pub fn zero() -> MessageId
Generate a MessageId
with value 0. This should only be used for messages where there is
no danger of duplication.
pub fn from_lost_node(name: XorName) -> MessageId
[src]
pub fn from_lost_node(name: XorName) -> MessageId
Generate a new MessageId
with contents extracted from lost node.
pub fn from_added_node(name: XorName) -> MessageId
[src]
pub fn from_added_node(name: XorName) -> MessageId
Generate a new MessageId
with contents extracted from new node.
pub fn from_reverse(name: &MessageId) -> MessageId
[src]
pub fn from_reverse(name: &MessageId) -> MessageId
Generate the reverse of the given MessageId
.
pub fn increment_first_byte(message_id: &MessageId) -> MessageId
[src]
pub fn increment_first_byte(message_id: &MessageId) -> MessageId
Generate the increment (on the MSB only) of the given MessageId
.
pub fn decrement_first_byte(message_id: &MessageId) -> MessageId
[src]
pub fn decrement_first_byte(message_id: &MessageId) -> MessageId
Generate the decrement (on the MSB only) of the given MessageId
.
Trait Implementations
impl Ord for MessageId
[src]
impl Ord for MessageId
fn cmp(&self, other: &MessageId) -> Ordering
[src]
fn cmp(&self, other: &MessageId) -> 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 MessageId
[src]
impl PartialOrd for MessageId
fn partial_cmp(&self, other: &MessageId) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &MessageId) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &MessageId) -> bool
[src]
fn lt(&self, other: &MessageId) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &MessageId) -> bool
[src]
fn le(&self, other: &MessageId) -> 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: &MessageId) -> bool
[src]
fn gt(&self, other: &MessageId) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &MessageId) -> bool
[src]
fn ge(&self, other: &MessageId) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Debug for MessageId
[src]
impl Debug for MessageId
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for MessageId
[src]
impl Clone for MessageId
fn clone(&self) -> MessageId
[src]
fn clone(&self) -> MessageId
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 Copy for MessageId
[src]
impl Copy for MessageId
impl Eq for MessageId
[src]
impl Eq for MessageId
impl PartialEq for MessageId
[src]
impl PartialEq for MessageId
fn eq(&self, other: &MessageId) -> bool
[src]
fn eq(&self, other: &MessageId) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &MessageId) -> bool
[src]
fn ne(&self, other: &MessageId) -> bool
This method tests for !=
.
impl Hash for MessageId
[src]
impl Hash for MessageId
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 Default for MessageId
[src]
impl Default for MessageId