pub struct GlobalId { /* private fields */ }
Expand description
Global id of backend nodes.
IDs are encoded using the “hashid” scheme, which uses a given alphabet and a salt to encode u64 numbers into a string hash.
Implementations§
Source§impl GlobalId
impl GlobalId
pub fn new(kind: NodeKind, database_id: u64) -> Self
pub fn kind(&self) -> NodeKind
pub fn database_id(&self) -> u64
Sourcepub fn encode_prefixed(&self) -> String
pub fn encode_prefixed(&self) -> String
Encode a prefixed global id.
Sourcepub fn parse_prefixed(hash: &str) -> Result<Self, GlobalIdParseError>
pub fn parse_prefixed(hash: &str) -> Result<Self, GlobalIdParseError>
Parse a prefixed global id.
Sourcepub fn encode_url(&self) -> String
pub fn encode_url(&self) -> String
Encode a non-prefixed global id.
Note: URL ids use a different alphabet than prefixed ids.
Sourcepub fn parse_url(hash: &str) -> Result<Self, GlobalIdParseError>
pub fn parse_url(hash: &str) -> Result<Self, GlobalIdParseError>
Parse a non-prefixed URL global id variant.
Note: URL ids use a different alphabet than prefixed ids.
Trait Implementations§
impl Copy for GlobalId
impl Eq for GlobalId
impl StructuralPartialEq for GlobalId
Auto Trait Implementations§
impl Freeze for GlobalId
impl RefUnwindSafe for GlobalId
impl Send for GlobalId
impl Sync for GlobalId
impl Unpin for GlobalId
impl UnwindSafe for GlobalId
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.