pub struct ObserverConfig { /* private fields */ }Expand description
Opt-in configuration that turns process observation on for a single
NativeProcess.
Constructing a config does not by itself observe anything; it is attached
to a process via
NativeProcess::with_observer.
With no config attached, the process emits no events (off by default).
Implementations§
Source§impl ObserverConfig
impl ObserverConfig
Sourcepub fn lifecycle() -> Self
pub fn lifecycle() -> Self
Create a config that observes only the Phase 1 lifecycle baseline.
This is the recommended Phase 1 constructor: it requests exactly the
category that is actually Supported.
Sourcepub fn with_categories(
categories: impl IntoIterator<Item = EventCategory>,
) -> Self
pub fn with_categories( categories: impl IntoIterator<Item = EventCategory>, ) -> Self
Create a config requesting an explicit set of categories.
Categories that are not Supported on this platform simply never
produce events in Phase 1; callers should consult
ObserverCapabilities::negotiate to learn which ones are honored.
Sourcepub fn observes(&self, category: EventCategory) -> bool
pub fn observes(&self, category: EventCategory) -> bool
Return whether this config requested observation of category.
Sourcepub fn categories(&self) -> &[EventCategory]
pub fn categories(&self) -> &[EventCategory]
The categories this config requested, in insertion order.
Trait Implementations§
Source§impl Clone for ObserverConfig
impl Clone for ObserverConfig
Source§fn clone(&self) -> ObserverConfig
fn clone(&self) -> ObserverConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ObserverConfig
impl RefUnwindSafe for ObserverConfig
impl Send for ObserverConfig
impl Sync for ObserverConfig
impl Unpin for ObserverConfig
impl UnsafeUnpin for ObserverConfig
impl UnwindSafe for ObserverConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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 more