[][src]Struct yyid::Yyid

pub struct Yyid(_);

A yniversally ynique identifier (Yyid).

Methods

impl<'a> Yyid[src]

pub const fn to_hyphenated_ref(&self) -> HyphenatedRef[src]

Creates a HyphenatedRef from a Yyid

pub const fn to_simple_ref(&self) -> SimpleRef[src]

Creates a SimpleRef from a Yyid

pub const fn to_urn_ref(&self) -> UrnRef[src]

Creates a UrnRef from a Yyid

impl<'a> Yyid[src]

pub fn new() -> Self[src]

Creates a new random YYID

Example

use yyid::Yyid;

let yyid = Yyid::new();
println!("{}", yyid);
// => "02e7f0f6-067e-8c92-b25c-12c9180540a9"

pub const fn nil() -> Self[src]

Special case: a "nil" YYID

Example

use yyid::Yyid;

let nil = Yyid::nil();
assert_eq!(
    nil.to_string(),
    "00000000-0000-0000-0000-000000000000"
);
assert_eq!(nil.as_bytes(), &[0u8; 16]);

pub fn is_nil(&self) -> bool[src]

Tests if the YYID is nil.

pub fn as_bytes(&self) -> &Bytes[src]

Return an array of 16 octets containing the YYID data

pub fn to_u128(&self) -> u128[src]

Returns a 128bit value containing the YYID data.

pub fn to_u128_le(&self) -> u128[src]

Returns a 128bit little-endian value containing the YYID data.

Trait Implementations

impl Clone for Yyid[src]

impl Copy for Yyid[src]

impl Debug for Yyid[src]

impl Default for Yyid[src]

impl Display for Yyid[src]

impl Eq for Yyid[src]

impl Hash for Yyid[src]

impl LowerHex for Yyid[src]

impl Ord for Yyid[src]

impl PartialEq<Yyid> for Yyid[src]

impl PartialOrd<Yyid> for Yyid[src]

impl StructuralEq for Yyid[src]

impl StructuralPartialEq for Yyid[src]

Auto Trait Implementations

impl RefUnwindSafe for Yyid

impl Send for Yyid

impl Sync for Yyid

impl Unpin for Yyid

impl UnwindSafe for Yyid

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.