#[non_exhaustive]pub enum ObserverEventKind {
Started,
Exited {
exit_code: i32,
},
DescendantStarted,
DescendantExited,
FileOpen {
path: PathBuf,
flags: u32,
},
FileWrite {
path: PathBuf,
byte_count: u64,
},
FileClose {
path: PathBuf,
},
FileUnlink {
path: PathBuf,
},
FileRename {
from: PathBuf,
to: PathBuf,
},
}Expand description
What happened to an observed process.
Marked #[non_exhaustive] per #431: Phase 3 will add variants for File,
Network, and Process events. Out-of-crate matchers must include a
wildcard arm to remain forward-compatible across minor releases.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Started
The child process was spawned. Carries no extra payload.
Exited
The child process exited. Carries the OS exit code (Unix signal exits are negative signal numbers, matching the rest of the crate).
DescendantStarted
A descendant of the spawned process (i.e. a child of a child) was
created. Emitted on the EventCategory::Process category by
per-OS LaunchedProcessTree backends (#539). The descendant PID is
carried by ObserverEvent::pid.
Unlike Started, this carries no exit code on the
pair event because the no-admin descendant-lifecycle primitives
(Windows Job Object IOCP, Linux pidfd reap, macOS EVFILT_PROC)
surface PID-only notifications.
DescendantExited
A descendant process exited. Emitted on the
EventCategory::Process category by per-OS LaunchedProcessTree
backends (#539). The descendant PID is carried by
ObserverEvent::pid; the exit code is not surfaced — see
DescendantStarted for rationale.
FileOpen
A file was opened by the observed process. Emitted on the
EventCategory::File category by the hook tier of the
observer (the sidecar interposer in running-process-observer,
tracked by #551). The pid in ObserverEvent::pid is the
process that performed the call. flags is the platform-native
open flags (POSIX O_* on Unix; Windows dwDesiredAccess |
(dwShareMode << 16) encoded best-effort).
Fields
FileWrite
A file was written to by the observed process. byte_count is
the byte count returned by the syscall on success (may be
shorter than the request on short writes). Emitted on the
EventCategory::File category by the hook tier (#551).
Fields
FileClose
A file descriptor / handle was closed. Emitted on the
EventCategory::File category by the hook tier (#551). The
path is resolved at hook-fire time from the fd / handle, so it
matches the path the corresponding FileOpen
event reported.
FileUnlink
A file was unlinked / deleted. Emitted on the
EventCategory::File category by the hook tier (#551).
FileRename
A file was renamed. Emitted on the EventCategory::File
category by the hook tier (#551).
Implementations§
Trait Implementations§
Source§impl Clone for ObserverEventKind
impl Clone for ObserverEventKind
Source§fn clone(&self) -> ObserverEventKind
fn clone(&self) -> ObserverEventKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ObserverEventKind
impl Debug for ObserverEventKind
impl Eq for ObserverEventKind
Source§impl PartialEq for ObserverEventKind
impl PartialEq for ObserverEventKind
impl StructuralPartialEq for ObserverEventKind
Auto Trait Implementations§
impl Freeze for ObserverEventKind
impl RefUnwindSafe for ObserverEventKind
impl Send for ObserverEventKind
impl Sync for ObserverEventKind
impl Unpin for ObserverEventKind
impl UnsafeUnpin for ObserverEventKind
impl UnwindSafe for ObserverEventKind
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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