[−][src]Struct mongodb::oid::ObjectId
A wrapper around raw 12-byte ObjectId representations.
Methods
impl ObjectId[src]
impl ObjectIdpub fn new() -> Result<ObjectId, Error>[src]
pub fn new() -> Result<ObjectId, Error>Generates a new ObjectID, represented in bytes. See the docs for more information.
pub fn with_bytes(bytes: [u8; 12]) -> ObjectId[src]
pub fn with_bytes(bytes: [u8; 12]) -> ObjectIdConstructs a new ObjectId wrapper around the raw byte representation.
pub fn with_string(s: &str) -> Result<ObjectId, Error>[src]
pub fn with_string(s: &str) -> Result<ObjectId, Error>Creates an ObjectID using a 12-byte (24-char) hexadecimal string.
pub fn with_timestamp(time: u32) -> ObjectId[src]
pub fn with_timestamp(time: u32) -> ObjectIdCreates 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]
pub fn bytes(&self) -> [u8; 12]Returns the raw byte representation of an ObjectId.
pub fn timestamp(&self) -> u32[src]
pub fn timestamp(&self) -> u32Retrieves the timestamp (seconds since epoch) from an ObjectId.
pub fn machine_id(&self) -> u32[src]
pub fn machine_id(&self) -> u32Retrieves the machine id associated with an ObjectId.
pub fn process_id(&self) -> u16[src]
pub fn process_id(&self) -> u16Retrieves the process id associated with an ObjectId.
pub fn counter(&self) -> u32[src]
pub fn counter(&self) -> u32Retrieves the increment counter from an ObjectId.
pub fn to_hex(&self) -> String[src]
pub fn to_hex(&self) -> StringConvert the objectId to hex representation.
Trait Implementations
impl Clone for ObjectId[src]
impl Clone for ObjectIdfn clone(&self) -> ObjectId[src]
fn clone(&self) -> ObjectIdfn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl Serialize for ObjectId[src]
impl Serialize for ObjectIdfn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer, [src]
fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer, impl<'de> Deserialize<'de> for ObjectId[src]
impl<'de> Deserialize<'de> for ObjectIdfn deserialize<D>(
deserializer: D
) -> Result<ObjectId, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>, [src]
fn deserialize<D>(
deserializer: D
) -> Result<ObjectId, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>, impl From<ObjectId> for Bson[src]
impl From<ObjectId> for Bsonimpl Hash for ObjectId[src]
impl Hash for ObjectIdfn hash<__H>(&self, state: &mut __H) where
__H: Hasher, [src]
fn hash<__H>(&self, state: &mut __H) where
__H: Hasher, fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, Feeds a slice of this type into the given [Hasher]. Read more
impl Eq for ObjectId[src]
impl Eq for ObjectIdimpl PartialEq<ObjectId> for ObjectId[src]
impl PartialEq<ObjectId> for ObjectIdimpl Display for ObjectId[src]
impl Display for ObjectIdimpl Ord for ObjectId[src]
impl Ord for ObjectIdfn cmp(&self, other: &ObjectId) -> Ordering[src]
fn cmp(&self, other: &ObjectId) -> Orderingfn max(self, other: Self) -> Self1.21.0[src]
fn max(self, other: Self) -> SelfCompares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self1.21.0[src]
fn min(self, other: Self) -> SelfCompares and returns the minimum of two values. Read more
impl PartialOrd<ObjectId> for ObjectId[src]
impl PartialOrd<ObjectId> for ObjectIdfn partial_cmp(&self, other: &ObjectId) -> Option<Ordering>[src]
fn partial_cmp(&self, other: &ObjectId) -> Option<Ordering>fn lt(&self, other: &ObjectId) -> bool[src]
fn lt(&self, other: &ObjectId) -> boolfn le(&self, other: &ObjectId) -> bool[src]
fn le(&self, other: &ObjectId) -> boolfn gt(&self, other: &ObjectId) -> bool[src]
fn gt(&self, other: &ObjectId) -> boolfn ge(&self, other: &ObjectId) -> bool[src]
fn ge(&self, other: &ObjectId) -> boolimpl Debug for ObjectId[src]
impl Debug for ObjectIdAuto Trait Implementations
Blanket Implementations
impl<T> From for T[src]
impl<T> From for Timpl<T, U> Into for T where
U: From<T>, [src]
impl<T, U> Into for T where
U: From<T>, impl<T> ToString for T where
T: Display + ?Sized, [src]
impl<T> ToString for T where
T: Display + ?Sized, impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, impl<T, U> TryFrom for T where
T: From<U>, [src]
impl<T, U> TryFrom for T where
T: From<U>, type Error = !
try_from)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>impl<T> Borrow for T where
T: ?Sized, [src]
impl<T> Borrow for T where
T: ?Sized, impl<T> Any for T where
T: 'static + ?Sized, [src]
impl<T> Any for T where
T: 'static + ?Sized, fn get_type_id(&self) -> TypeId[src]
fn get_type_id(&self) -> TypeIdimpl<T, U> TryInto for T where
U: TryFrom<T>, [src]
impl<T, U> TryInto for T where
U: TryFrom<T>, type Error = <U as TryFrom<T>>::Error
try_from)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>impl<T> BorrowMut for T where
T: ?Sized, [src]
impl<T> BorrowMut for T where
T: ?Sized, fn borrow_mut(&mut self) -> &mut T[src]
fn borrow_mut(&mut self) -> &mut Timpl<T> DeserializeOwned for T where
T: Deserialize<'de>, [src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>, impl<T, U> TryInto for T where
U: TryFrom<T>,
impl<T, U> TryInto for T where
U: TryFrom<T>, impl<Q, K> Equivalent for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized, [src]
impl<Q, K> Equivalent for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized, fn equivalent(&self, key: &K) -> bool[src]
fn equivalent(&self, key: &K) -> boolimpl<T> Same for T
impl<T> Same for Ttype Output = T
Should always be Self