pub struct ExternalId(/* private fields */);Expand description
An external-id used to identify external entities, that are not in the borderless-network.
These ids are version 8 uuids, where
the first four bits of the uuid are set to 0xe, to indicate that it is an external-id and not another uuid based id.
Example:
ebc23cb3-f447-8107-8f93-9bfb8e1d157dAll uuid-based ids used in the borderless-ecosystem have a different prefix, based on what the id is used for. This mechanism ensures that you cannot mistake an participant-id for e.g. a contract-id and vice versa. Even if you convert the participant-id back into a uuid and the result into a contract-id, the results are different.
The implementation of the IDs is compliant with RFC9562, as we utilize standard version 8 uuids.
Implementations§
Source§impl ExternalId
impl ExternalId
Sourcepub fn into_uuid(self) -> Uuid
pub fn into_uuid(self) -> Uuid
Converts the ID into a uuid::Uuid
pub fn from_bytes(bytes: [u8; 16]) -> ExternalId
pub fn from_slice(slice: &[u8]) -> Result<ExternalId, TryFromSliceError>
Sourcepub fn into_bytes(self) -> [u8; 16]
pub fn into_bytes(self) -> [u8; 16]
Returns the underlying bytes
Sourcepub fn merge(&self, other: &ExternalId) -> [u8; 16]
pub fn merge(&self, other: &ExternalId) -> [u8; 16]
Merges two IDs commutatively
Can be used to construct database keys.
Sourcepub fn merge_compact(&self, other: &ExternalId) -> u64
pub fn merge_compact(&self, other: &ExternalId) -> u64
Merges and Compacts two IDs into a u64
Can be used to construct database keys.
Trait Implementations§
Source§impl AsRef<[u8]> for ExternalId
impl AsRef<[u8]> for ExternalId
Source§impl Clone for ExternalId
impl Clone for ExternalId
Source§fn clone(&self) -> ExternalId
fn clone(&self) -> ExternalId
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more