Struct sparkle::SerialNumber
[−]
[src]
pub struct SerialNumber(pub u32);
Encapsulates a zone's serial number.
SerialNumber
uses sequence space arithmetic, defined in RFC
1982. Sequence space arithmetic
defines the addition and comparison operations such that the serial
number wraps on overflow while maintaining an intuitive and well defined
meaning for the operations' results.
Examples
use sparkle::SerialNumber; let x = SerialNumber(0); assert!(x < x + SerialNumber(1)); let x = SerialNumber(0x_ffff_ffff); assert!(x < x + SerialNumber(1));
Methods
impl SerialNumber
[src]
Trait Implementations
impl Clone for SerialNumber
[src]
fn clone(&self) -> SerialNumber
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Copy for SerialNumber
[src]
impl Debug for SerialNumber
[src]
impl Eq for SerialNumber
[src]
impl Hash for SerialNumber
[src]
fn hash<__H: Hasher>(&self, __arg_0: &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
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl PartialEq for SerialNumber
[src]
fn eq(&self, __arg_0: &SerialNumber) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &SerialNumber) -> bool
This method tests for !=
.
impl Display for SerialNumber
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl PartialOrd for SerialNumber
[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Add for SerialNumber
[src]
type Output = Self
The resulting type after applying the +
operator
fn add(self, other: Self) -> Self::Output
The method for the +
operator
impl AddAssign for SerialNumber
[src]
fn add_assign(&mut self, other: Self)
The method for the +=
operator