pub struct LogSinkRegistration { /* private fields */ }Expand description
RAII guard that unregisters a LogSink from the singleton
LogSinkCardSubscriber when dropped.
Returned by register_log_sink. The guard owns a strong Arc to
the singleton subscriber and the monotonic id assigned at registration
time. Drop removes the matching (id, LogSink) entry via
Vec::retain.
§Concurrency
Send + Sync. Drop::drop acquires the subscriber’s sinks mutex
once, using the poison-recovery policy: a panic in another thread that
left the lock poisoned does NOT prevent unregistration. The drop
races safely with concurrent CardEventBus::publish fan-outs because
the publisher takes a snapshot clone of the sinks vec before iterating;
an in-flight publish may or may not observe the just-unregistered sink,
but never deadlocks and never observes torn state.
Dropping the guard is O(N) in the number of registered sinks (typically
== active session count). Callers must not hold the returned guard
across .await points that could execute on a runtime worker also
running the fan-out — with the current single-shot lock scope this is
not a hazard.
Trait Implementations§
Source§impl Debug for LogSinkRegistration
impl Debug for LogSinkRegistration
Source§impl Drop for LogSinkRegistration
impl Drop for LogSinkRegistration
Auto Trait Implementations§
impl Freeze for LogSinkRegistration
impl RefUnwindSafe for LogSinkRegistration
impl Send for LogSinkRegistration
impl Sync for LogSinkRegistration
impl Unpin for LogSinkRegistration
impl UnsafeUnpin for LogSinkRegistration
impl UnwindSafe for LogSinkRegistration
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
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>
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>
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 moreimpl<T> MaybeSend for Twhere
T: Send,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.