#[non_exhaustive]pub struct TenantRealtime { /* private fields */ }Expand description
In-process realtime facade permanently bound to one authenticated tenant.
Logical channel names are mapped to an immutable tenant namespace before a channel is opened or published. Authentication and room-level authorization remain application responsibilities; this wrapper prevents accidental cross-tenant reuse of the same logical room name.
Implementations§
Source§impl TenantRealtime
impl TenantRealtime
Sourcepub fn from_context(
manager: Arc<BroadcastManager>,
context: &TenantContext,
) -> TenantRealtime
pub fn from_context( manager: Arc<BroadcastManager>, context: &TenantContext, ) -> TenantRealtime
Binds a shared broadcast manager to an authenticated tenant context.
Sourcepub fn tenant_id(&self) -> &str
pub fn tenant_id(&self) -> &str
Returns the authenticated tenant identifier bound to this instance.
Sourcepub fn namespaced_channel(
&self,
logical_channel: &str,
) -> Result<String, RealtimeError>
pub fn namespaced_channel( &self, logical_channel: &str, ) -> Result<String, RealtimeError>
Returns the canonical backend channel inside this tenant namespace.
Sourcepub fn subscribe(
&self,
logical_channel: &str,
) -> Result<Receiver<RealtimeMessage>, RealtimeError>
pub fn subscribe( &self, logical_channel: &str, ) -> Result<Receiver<RealtimeMessage>, RealtimeError>
Subscribes only to the tenant-scoped version of a logical channel.
Trait Implementations§
Source§impl Clone for TenantRealtime
impl Clone for TenantRealtime
Source§fn clone(&self) -> TenantRealtime
fn clone(&self) -> TenantRealtime
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for TenantRealtime
impl !UnwindSafe for TenantRealtime
impl Freeze for TenantRealtime
impl Send for TenantRealtime
impl Sync for TenantRealtime
impl Unpin for TenantRealtime
impl UnsafeUnpin for TenantRealtime
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more