pub struct TenantId(/* private fields */);Expand description
Unique identifier for a tenant (organization/customer).
Implementations§
Source§impl TenantId
impl TenantId
pub fn new(id: u64) -> Self
Sourcepub fn from_stream_id(stream_id: StreamId) -> Self
pub fn from_stream_id(stream_id: StreamId) -> Self
Extracts tenant ID from stream ID (upper 32 bits).
Bit Layout:
- Upper 32 bits:
tenant_id(supports 4.3B tenants) - Lower 32 bits:
local_stream_id(4.3B streams per tenant)
§Examples
let stream_id = StreamId::from_tenant_and_local(TenantId::from(5), 1);
assert_eq!(TenantId::from_stream_id(stream_id), TenantId::from(5));Trait Implementations§
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
Source§impl Ord for TenantId
impl Ord for TenantId
Source§impl PartialOrd for TenantId
impl PartialOrd for TenantId
impl Copy for TenantId
impl Eq 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 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