pub struct ObjectDigest(/* private fields */);Expand description
The digest of an Object.
Implementations§
Source§impl ObjectDigest
impl ObjectDigest
Sourcepub const LENGTH: usize = Digest::LENGTH
pub const LENGTH: usize = Digest::LENGTH
A constant representing the length of the digest in bytes.
Sourcepub const fn new(digest: [u8; 32]) -> Self
pub const fn new(digest: [u8; 32]) -> Self
Generates a new digest from the provided 32 byte array.
Sourcepub fn random_with<R>(rng: R) -> Self
Available on crate feature rand only.
pub fn random_with<R>(rng: R) -> Self
rand only.Generates a new digest from the provided random number generator.
Sourcepub const fn into_digest(self) -> Digest
pub const fn into_digest(self) -> Digest
Returns the underlying Digest.
Sourcepub const fn inner(&self) -> &[u8; 32]
pub const fn inner(&self) -> &[u8; 32]
Returns a reference to the inner array representation of this digest.
Sourcepub const fn into_inner(self) -> [u8; 32]
pub const fn into_inner(self) -> [u8; 32]
Returns the inner array representation of this digest.
Sourcepub fn from_base58<T: AsRef<[u8]>>(base58: T) -> Result<Self, DigestParseError>
pub fn from_base58<T: AsRef<[u8]>>(base58: T) -> Result<Self, DigestParseError>
Decodes a digest from a Base58 encoded string.
Sourcepub fn to_base58(&self) -> String
pub fn to_base58(&self) -> String
Returns a Base58 encoded string representation of this digest.
Sourcepub fn from_bytes(bytes: impl AsRef<[u8]>) -> Result<Self, DigestParseError>
pub fn from_bytes(bytes: impl AsRef<[u8]>) -> Result<Self, DigestParseError>
Generates a digest from bytes.
Sourcepub const fn next_lexicographical(&self) -> Self
pub const fn next_lexicographical(&self) -> Self
Returns the next digest in byte-increasing order.
Sourcepub const fn next_lexicographical_opt(&self) -> Option<Self>
pub const fn next_lexicographical_opt(&self) -> Option<Self>
Returns the next digest in byte-increasing order, or None if the
result would overflow.
Source§impl ObjectDigest
impl ObjectDigest
Sourcepub const OBJECT_DELETED: Self
pub const OBJECT_DELETED: Self
A marker that signifies the object is deleted.
Sourcepub const OBJECT_WRAPPED: Self
pub const OBJECT_WRAPPED: Self
A marker that signifies the object is wrapped into another object.
Sourcepub const OBJECT_CANCELED: Self
pub const OBJECT_CANCELED: Self
A marker that signifies the object is canceled.
Sourcepub fn is_alive(&self) -> bool
pub fn is_alive(&self) -> bool
Returns whether the digest represents an object that is neither deleted nor wrapped.
Sourcepub fn is_deleted(&self) -> bool
pub fn is_deleted(&self) -> bool
Returns whether the digest represents a deleted object.
Sourcepub fn is_wrapped(&self) -> bool
pub fn is_wrapped(&self) -> bool
Returns whether the digest represents an object wrapped in another object.
Trait Implementations§
Source§impl Arbitrary for ObjectDigest
Available on crate feature proptest only.
impl Arbitrary for ObjectDigest
proptest only.Source§type Parameters = ()
type Parameters = ()
arbitrary_with accepts for configuration
of the generated Strategy. Parameters must implement Default.Source§type Strategy = BoxedStrategy<ObjectDigest>
type Strategy = BoxedStrategy<ObjectDigest>
Strategy used to generate values of type Self.Source§fn arbitrary_with(
args_shared: <Self as Arbitrary>::Parameters,
) -> Self::Strategy
fn arbitrary_with( args_shared: <Self as Arbitrary>::Parameters, ) -> Self::Strategy
Source§impl AsRef<[u8]> for ObjectDigest
impl AsRef<[u8]> for ObjectDigest
Source§impl Clone for ObjectDigest
impl Clone for ObjectDigest
Source§fn clone(&self) -> ObjectDigest
fn clone(&self) -> ObjectDigest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ObjectDigest
Source§impl Debug for ObjectDigest
impl Debug for ObjectDigest
Source§impl Default for ObjectDigest
impl Default for ObjectDigest
Source§fn default() -> ObjectDigest
fn default() -> ObjectDigest
Source§impl<'de> Deserialize<'de> for ObjectDigest
Available on crate feature serde only.
impl<'de> Deserialize<'de> for ObjectDigest
serde only.Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for ObjectDigest
impl Display for ObjectDigest
impl Eq for ObjectDigest
Source§impl From<Digest> for ObjectDigest
impl From<Digest> for ObjectDigest
Source§impl From<ObjectDigest> for Digest
impl From<ObjectDigest> for Digest
Source§fn from(digest: ObjectDigest) -> Self
fn from(digest: ObjectDigest) -> Self
Source§impl From<ObjectDigest> for [u8; 32]
impl From<ObjectDigest> for [u8; 32]
Source§fn from(digest: ObjectDigest) -> Self
fn from(digest: ObjectDigest) -> Self
Source§impl FromStr for ObjectDigest
impl FromStr for ObjectDigest
Source§impl Hash for ObjectDigest
impl Hash for ObjectDigest
Source§impl LowerHex for ObjectDigest
impl LowerHex for ObjectDigest
Source§impl Ord for ObjectDigest
impl Ord for ObjectDigest
Source§fn cmp(&self, other: &ObjectDigest) -> Ordering
fn cmp(&self, other: &ObjectDigest) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for ObjectDigest
impl PartialEq for ObjectDigest
Source§impl PartialOrd for ObjectDigest
impl PartialOrd for ObjectDigest
Source§impl Serialize for ObjectDigest
Available on crate feature serde only.
impl Serialize for ObjectDigest
serde only.impl StructuralPartialEq for ObjectDigest
Auto Trait Implementations§
impl Freeze for ObjectDigest
impl RefUnwindSafe for ObjectDigest
impl Send for ObjectDigest
impl Sync for ObjectDigest
impl Unpin for ObjectDigest
impl UnsafeUnpin for ObjectDigest
impl UnwindSafe for ObjectDigest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ToHex for T
impl<T> ToHex for T
Source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
self into the result. Lower case
letters are used (e.g. f9b4ca)Source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
self into the result. Upper case
letters are used (e.g. F9B4CA)