[][src]Struct mongodb_cwal::oid::ObjectId

pub struct ObjectId { /* fields omitted */ }

A wrapper around raw 12-byte ObjectId representations.

Implementations

impl ObjectId[src]

pub fn new() -> Result<ObjectId, Error>[src]

Generates a new ObjectID, represented in bytes. See the docs for more information.

pub fn with_bytes(bytes: [u8; 12]) -> ObjectId[src]

Constructs a new ObjectId wrapper around the raw byte representation.

pub fn with_string(s: &str) -> Result<ObjectId, Error>[src]

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

pub fn with_timestamp(time: u32) -> ObjectId[src]

Creates a dummy ObjectId with a specific generation time. This method should only be used to do range queries on a field containing ObjectId instances.

pub fn bytes(&self) -> [u8; 12][src]

Returns the raw byte representation of an ObjectId.

pub fn timestamp(&self) -> u32[src]

Retrieves the timestamp (seconds since epoch) from an ObjectId.

pub fn counter(&self) -> u32[src]

Retrieves the increment counter from an ObjectId.

pub fn to_hex(&self) -> String[src]

Convert the objectId to hex representation.

Trait Implementations

impl Clone for ObjectId[src]

impl Debug for ObjectId[src]

impl<'de> Deserialize<'de> for ObjectId[src]

impl Display for ObjectId[src]

impl Eq for ObjectId[src]

impl From<ObjectId> for Bson[src]

impl Hash for ObjectId[src]

impl Ord for ObjectId[src]

impl PartialEq<ObjectId> for ObjectId[src]

impl PartialOrd<ObjectId> for ObjectId[src]

impl Serialize for ObjectId[src]

impl StructuralEq for ObjectId[src]

impl StructuralPartialEq for ObjectId[src]

Auto Trait Implementations

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,