Struct kitsune_p2p_types::tx2::tx2_utils::Active [−][src]
pub struct Active(_);
Expand description
Active tracking helper for related items. This facilitates e.g. an endpoint with sub connections. The endpoint can close, closing all connections. Or, individual connections can close, without closing the endpoint.
Implementations
Mix two active trackers to gether. The result will be inactive if either parent is inactive.
Register a callback to be invoked on kill. Beware the cb may be invoked multiple times if this Active is mixed.
If any of the mixed trackers in this instance are not active, this fn will return false.
pub fn fut<'a, 'b, R, F>(
&'a self,
f: F
) -> impl Future<Output = KitsuneResult<R>> + 'b + Send where
R: 'static + Send,
F: Future<Output = KitsuneResult<R>> + 'b + Send,
pub fn fut<'a, 'b, R, F>(
&'a self,
f: F
) -> impl Future<Output = KitsuneResult<R>> + 'b + Send where
R: 'static + Send,
F: Future<Output = KitsuneResult<R>> + 'b + Send,
Wrap a future such that if any of the sub-trackers within this active tracker instance become inactive before the future resolve, resolve with a Err::Closed result.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Active
impl !UnwindSafe for Active
Blanket Implementations
Mutably borrows from an owned value. Read more
fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more