pub struct StatementId(/* private fields */);Expand description
Identifies a statement: one value of one field of an entity, with its qualifiers.
New identifiers are version 4 UUIDs. The text form is the lowercase hyphenated form of the UUID; in CBOR, an identifier is a UUID tag.
Implementations§
Source§impl StatementId
impl StatementId
Sourcepub fn from_random_bytes(bytes: [u8; 16]) -> Self
pub fn from_random_bytes(bytes: [u8; 16]) -> Self
Makes a new identifier from 16 random bytes. Six of the bits are replaced by the version and variant of a version 4 UUID.
Sourcepub fn derived(context: &str, material: &[u8]) -> Self
pub fn derived(context: &str, material: &[u8]) -> Self
The identifier derived from material with context: the first 16 bytes of
the BLAKE3 key derived with that context from it, as a version 4 UUID. Every
replica that derives one from the same material gets the same identifier.
Sourcepub fn random(rng: &mut impl CryptoRng) -> Self
pub fn random(rng: &mut impl CryptoRng) -> Self
Makes a new identifier from 16 bytes of the random number generator.
Sourcepub fn from_bytes(bytes: [u8; 16]) -> Self
pub fn from_bytes(bytes: [u8; 16]) -> Self
Returns the identifier with these 16 bytes, as stored. Any UUID is accepted, because an identifier is opaque.
Trait Implementations§
Source§impl Clone for StatementId
impl Clone for StatementId
impl Copy for StatementId
Source§impl Debug for StatementId
impl Debug for StatementId
Source§impl Display for StatementId
impl Display for StatementId
impl Eq for StatementId
Source§impl FromCbor for StatementId
impl FromCbor for StatementId
Source§impl FromStr for StatementId
impl FromStr for StatementId
Source§impl Hash for StatementId
impl Hash for StatementId
Source§impl Ord for StatementId
impl Ord for StatementId
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for StatementId
impl PartialEq for StatementId
Source§impl PartialOrd for StatementId
impl PartialOrd for StatementId
impl StructuralPartialEq for StatementId
Auto Trait Implementations§
impl Forget for StatementId
impl Freeze for StatementId
impl Move for StatementId
impl RefUnwindSafe for StatementId
impl Send for StatementId
impl Sync for StatementId
impl Unpin for StatementId
impl UnsafeUnpin for StatementId
impl UnwindSafe for StatementId
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
Mutably borrows from an owned value. Read more