Struct trackable::TrackingNumber [] [src]

pub struct TrackingNumber(pub u64);

Randomly generated tracking number.

This is provided to help identifying a tracking target object.

Note that the numbers are generated by rand::random() function, thus it is not guaranteed to have strict uniqueness.

Examples

use trackable::TrackingNumber;

let n0 = TrackingNumber::generate();
let n1 = TrackingNumber::generate();

// NOTE: The actual values will change every time the below code is executed.
assert_ne!(n0, n1);
assert_eq!(n0.to_string(), "91fe3f35b6022840");
assert_eq!(n1.to_string(), "3d1a76ec17fb838f");

Methods

impl TrackingNumber
[src]

Generates a new tracking number.

Trait Implementations

impl Debug for TrackingNumber
[src]

Formats the value using the given formatter.

impl Clone for TrackingNumber
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for TrackingNumber
[src]

impl PartialOrd for TrackingNumber
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Ord for TrackingNumber
[src]

This method returns an Ordering between self and other. Read more

impl PartialEq for TrackingNumber
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for TrackingNumber
[src]

impl Hash for TrackingNumber
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl Display for TrackingNumber
[src]

Formats the value using the given formatter. Read more