pub struct TenantId(pub u32);Expand description
Resolved tenant ordinal: the 4-byte prefix of every tenant-owned key . Assigned once by the tenant directory and never reused, so a purged tenant’s leftovers can never become visible to a later tenant.
Tuple Fields§
§0: u32Implementations§
Source§impl TenantId
impl TenantId
Sourcepub const FIRST_ASSIGNED: u32 = 2
pub const FIRST_ASSIGNED: u32 = 2
First ordinal the tenant directory assigns.
Sourcepub const UNREGISTERED: Self
pub const UNREGISTERED: Self
A scope the directory has never registered. Never assigned, so it owns no keys: every read through it is empty.
Sourcepub const fn from_ordinal(ordinal: u64) -> Self
pub const fn from_ordinal(ordinal: u64) -> Self
A tenant id from an ordinal the caller already resolved (tests, embedders, and the directory itself).
§Panics
Panics if ordinal does not fit the 4-byte key prefix.
Sourcepub const fn to_be_bytes(self) -> [u8; 4]
pub const fn to_be_bytes(self) -> [u8; 4]
Big-endian key-prefix bytes.
Trait Implementations§
impl Copy for TenantId
Source§impl<'de> Deserialize<'de> for TenantId
impl<'de> Deserialize<'de> for TenantId
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for TenantId
Source§impl Ord for TenantId
impl Ord for TenantId
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 PartialOrd for TenantId
impl PartialOrd for TenantId
impl StructuralPartialEq for TenantId
Auto Trait Implementations§
impl Freeze for TenantId
impl RefUnwindSafe for TenantId
impl Send for TenantId
impl Sync for TenantId
impl Unpin for TenantId
impl UnsafeUnpin for TenantId
impl UnwindSafe for TenantId
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§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.