[][src]Struct avocado::uid::Uid

pub struct Uid<T: Doc>(_);

A newtype wrapper to provide type safety for unique IDs of Documents that share the same underlying raw ID type.

It serializes and deserializes transparently as if it were a value of type <T as Doc>::Id.

Methods

impl<T: Doc> Uid<T>
[src]

Creates a strongly-typed Uid<T> from a raw representation.

Converts the strongly-typed Uid<T> into its raw representation.

impl<T: Doc<Id = ObjectId>> Uid<T>
[src]

Convenience methods for ObjectId-valued Uids.

Generates a new ObjectId-valued unique ID.

Constructs a wrapper around an ObjectId represented by raw bytes.

Creates an ObjectID-valued Uid using a 12-byte (24-char) hexadecimal string.

impl<T: Doc<Id = Uuid>> Uid<T>
[src]

Convenience methods for Uuid-valued Uids.

Creates a new random (v4) UUID-backed ID.

Creates a Uid backed by a Uuid of the exact bytes specified.

Creates a Uid backed by a Uuid based on the bytes supplied, modified so that the result is a valid v4 variant.

Trait Implementations

impl<T: Doc> Ord for Uid<T> where
    T::Id: Ord
[src]

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

impl<T: Doc> PartialEq<Uid<T>> for Uid<T>
[src]

This method tests for !=.

impl<T: Doc> From<Uid<T>> for Bson where
    T::Id: Into<Bson>, 
[src]

impl<T: Doc, '_> From<&'_ Uid<T>> for Bson where
    T::Id: ToOwned,
    <T::Id as ToOwned>::Owned: Into<Bson>, 
[src]

impl<T: Doc> Clone for Uid<T> where
    T::Id: Clone
[src]

Performs copy-assignment from source. Read more

impl<T: Doc> Copy for Uid<T> where
    T::Id: Copy
[src]

impl<T: Doc> Eq for Uid<T>
[src]

impl<T: Doc> PartialOrd<Uid<T>> for Uid<T> where
    T::Id: PartialOrd
[src]

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<T: Doc> AsRef<<T as Doc>::Id> for Uid<T>
[src]

impl<T: Doc> Default for Uid<T> where
    T::Id: Default
[src]

impl<T: Doc> Display for Uid<T> where
    T::Id: Display
[src]

impl<T: Doc> Debug for Uid<T> where
    T::Id: Debug
[src]

impl<T: Doc> FromStr for Uid<T> where
    T::Id: FromStr
[src]

The associated error which can be returned from parsing.

impl<T: Doc> Hash for Uid<T> where
    T::Id: Hash
[src]

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

impl<'a, T: Doc> Deserialize<'a> for Uid<T>
[src]

impl<T: Doc> Serialize for Uid<T>
[src]

impl<T: Doc> BsonSchema for Uid<T> where
    T::Id: BsonSchema
[src]

Auto Trait Implementations

impl<T> Send for Uid<T> where
    <T as Doc>::Id: Send

impl<T> Sync for Uid<T> where
    <T as Doc>::Id: Sync

Blanket Implementations

impl<T> From for T
[src]

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

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

impl<T> ToHex for T where
    T: AsRef<[u8]>, 

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<'a, T> TryFrom for T where
    T: FromStr

impl<Q, K> Equivalent for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 

impl<T> Same for T

Should always be Self