pub struct Engine {
pub protect: ProtectContext,
pub rule_errors: Vec<String>,
/* private fields */
}Fields§
§protect: ProtectContext§rule_errors: Vec<String>Implementations§
Source§impl Engine
impl Engine
Sourcepub fn live(
cfg: &Config,
state: Option<StateDb>,
on_demand: bool,
offline: bool,
) -> Self
pub fn live( cfg: &Config, state: Option<StateDb>, on_demand: bool, offline: bool, ) -> Self
Live engine for this machine (user rules from the default config dir).
Sourcepub fn live_in(
cfg: &Config,
state: Option<StateDb>,
on_demand: bool,
offline: bool,
config_dir: Option<&Path>,
) -> Self
pub fn live_in( cfg: &Config, state: Option<StateDb>, on_demand: bool, offline: bool, config_dir: Option<&Path>, ) -> Self
Live engine reading user rules from config_dir/rules.d (--config moves the config dir).
Sourcepub fn replay(cfg: &Config, path: &Path) -> Result<Self, String>
pub fn replay(cfg: &Config, path: &Path) -> Result<Self, String>
Engine replaying a fixture file (--replay).
Sourcepub fn replay_in(
cfg: &Config,
path: &Path,
config_dir: Option<&Path>,
) -> Result<Self, String>
pub fn replay_in( cfg: &Config, path: &Path, config_dir: Option<&Path>, ) -> Result<Self, String>
Replay engine with user rules from config_dir/rules.d. Never persists state, never probes adapters.
Sourcepub fn rule_warnings(&self, allowlist: &[String]) -> Vec<String>
pub fn rule_warnings(&self, allowlist: &[String]) -> Vec<String>
Rule-file lint (doctor): e.g. match.env keys outside the marker allowlist, which can never match.
Sourcepub fn lineage_len(&self) -> usize
pub fn lineage_len(&self) -> usize
In-memory lineage entries (tests, doctor).
Sourcepub fn flush(&mut self)
pub fn flush(&mut self)
Persists the lineage journal (entries seen since the last flush) and anything else the state store has queued.
Sourcepub fn set_learning(&mut self, learn: bool)
pub fn set_learning(&mut self, learn: bool)
--no-learn: the machine profile is not refreshed and the state store records no learning signals.
The lineage journal is attribution, not learning, and is always kept.
Sourcepub fn set_state_read_only(&mut self)
pub fn set_state_read_only(&mut self)
Read the state store but never write it (reclaim --dry-run). Not reversible for this engine.
Sourcepub fn replay_done(&self) -> bool
pub fn replay_done(&self) -> bool
True once a replay has handed out its last frame (further snapshots repeat it); always false live.
Sourcepub fn is_live(&self) -> bool
pub fn is_live(&self) -> bool
True for a live engine (actions may be executed); false when replaying a fixture.
Sourcepub fn enrich(&mut self, s: Snapshot) -> Snapshot
pub fn enrich(&mut self, s: Snapshot) -> Snapshot
Full enrichment pipeline on one raw snapshot.
Sourcepub fn self_group(s: &Snapshot) -> Option<String>
pub fn self_group(s: &Snapshot) -> Option<String>
Group id containing oomtop itself (for MCP: the calling agent’s session).
pub fn state_mut(&mut self) -> Option<&mut StateDb>
Trait Implementations§
Source§impl SnapshotProvider for Engine
impl SnapshotProvider for Engine
Source§fn snapshot(&mut self) -> Snapshot
fn snapshot(&mut self) -> Snapshot
Source§fn snapshot_now(&mut self) -> Snapshot
fn snapshot_now(&mut self) -> Snapshot
Self::snapshot but samples every source now, ignoring the cadence (the TUI’s second
sample 500 ms after start, so CPU % appears within a second; a refresh right after an action).Source§fn history(&self) -> &History
fn history(&self) -> &History
Source§fn headroom_config(&self) -> HeadroomConfig
fn headroom_config(&self) -> HeadroomConfig
Auto Trait Implementations§
impl !Freeze for Engine
impl !RefUnwindSafe for Engine
impl !Sync for Engine
impl !UnwindSafe for Engine
impl Forget for Engine
impl Move for Engine
impl Send for Enginewhere
BoxRaw<Sampler>: Send,
RawVecInner: Send,
&'static str: Send,
String: Send,
NodeRef<Owned, String, SourceStatus, LeafOrInternal>: Send,
BoxRaw<(String, SourceStatus)>: Send,
NodeRef<Owned, String, u32, LeafOrInternal>: Send,
BoxRaw<(String, u32)>: Send,
NodeRef<Owned, String, String, LeafOrInternal>: Send,
BoxRaw<(String, String)>: Send,
Mutex<Memo>: Send,
RawTable<(Vec<u8>, Vec<usize>)>: Send,
Arc<dyn AcAutomaton>: Send,
RawTable<(Vec<u8>, Vec<(usize, Regex)>)>: Send,
Arc<RegexI>: Send,
BoxRaw<Pool<Cache, Box<dyn Fn() -> Cache + RefUnwindSafe + Send + UnwindSafe + Sync>>>: Send,
Arc<Pool<PatternSet, Box<dyn Fn() -> PatternSet + RefUnwindSafe + Send + UnwindSafe + Sync>>>: Send,
Arc<str>: Send,
Arc<[String]>: Send,
Mutex<Option<(u64, Vec<Group>)>>: Send,
Connection: Send,
RawTable<(String, String)>: Send,
NodeRef<Owned, ProcId, LineageEntry, LeafOrInternal>: Send,
BoxRaw<(ProcId, LineageEntry)>: Send,
NodeRef<Owned, String, (String, u64, u64), LeafOrInternal>: Send,
BoxRaw<(String, (String, u64, u64))>: Send,
NodeRef<Owned, String, (u64, u64), LeafOrInternal>: Send,
BoxRaw<(String, (u64, u64))>: Send,
RawTable<(ProcId, u64)>: Send,
RawTable<(ProcId, (Option<u64>, Option<u64>))>: Send,
RawTable<(ProcId, ())>: Send,
NodeRef<Owned, String, (u64, Option<EndedSession>), LeafOrInternal>: Send,
BoxRaw<(String, (u64, Option<EndedSession>))>: Send,
NodeRef<Owned, String, u16, LeafOrInternal>: Send,
BoxRaw<(String, u16)>: Send,
NodeRef<Owned, String, Series, LeafOrInternal>: Send,
BoxRaw<(String, Series)>: Send,
NodeRef<Owned, String, CpuObs, LeafOrInternal>: Send,
BoxRaw<(String, CpuObs)>: Send,
impl Unpin for Enginewhere
Box<Sampler>: Unpin,
*const u8 is !null: Unpin,
&'static str: Unpin,
String: Unpin,
*const LeafNode<String, SourceStatus> is !null: Unpin,
Box<(String, SourceStatus)>: Unpin,
*const LeafNode<String, u32> is !null: Unpin,
Box<(String, u32)>: Unpin,
*const LeafNode<String, String> is !null: Unpin,
Box<(String, String)>: Unpin,
Align4<u32>: Unpin,
Align1<u8>: Unpin,
Arc<dyn AcAutomaton>: Unpin,
Arc<RegexI>: Unpin,
Box<Pool<Cache, Box<dyn Fn() -> Cache + RefUnwindSafe + Send + UnwindSafe + Sync>>>: Unpin,
Arc<Pool<PatternSet, Box<dyn Fn() -> PatternSet + RefUnwindSafe + Send + UnwindSafe + Sync>>>: Unpin,
Arc<str>: Unpin,
Arc<[String]>: Unpin,
*mut sqlite3: Unpin,
Arc<Mutex<*mut sqlite3>>: Unpin,
*const Node<Arc<str>, RawStatement> is !null: Unpin,
*const LeafNode<ProcId, LineageEntry> is !null: Unpin,
Box<(ProcId, LineageEntry)>: Unpin,
*const LeafNode<String, (String, u64, u64)> is !null: Unpin,
Box<(String, (String, u64, u64))>: Unpin,
*const LeafNode<String, (u64, u64)> is !null: Unpin,
Box<(String, (u64, u64))>: Unpin,
*const LeafNode<String, (u64, Option<EndedSession>)> is !null: Unpin,
Box<(String, (u64, Option<EndedSession>))>: Unpin,
*const LeafNode<String, u16> is !null: Unpin,
Box<(String, u16)>: Unpin,
*const LeafNode<String, Series> is !null: Unpin,
Box<(String, Series)>: Unpin,
*const LeafNode<String, CpuObs> is !null: Unpin,
Box<(String, CpuObs)>: Unpin,
impl UnsafeUnpin for Enginewhere
*const Sampler is !null: UnsafeUnpin,
PhantomData<Sampler>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<Snapshot>: UnsafeUnpin,
PhantomData<Rule>: UnsafeUnpin,
Align4<u32>: UnsafeUnpin,
Align1<u8>: UnsafeUnpin,
PhantomData<(u64, Option<usize>)>: UnsafeUnpin,
PhantomData<((u64, GroupKind), String)>: UnsafeUnpin,
PhantomData<((u64, Option<u32>, u32), (GroupKind, String))>: UnsafeUnpin,
PhantomData<CompiledRule>: UnsafeUnpin,
PhantomData<GlobSetMatchStrategy>: UnsafeUnpin,
PhantomData<Glob>: UnsafeUnpin,
PhantomData<usize>: UnsafeUnpin,
*const ArcInner<RegexI> is !null: UnsafeUnpin,
PhantomData<ArcInner<RegexI>>: UnsafeUnpin,
*const Pool<Cache, Box<dyn Fn() -> Cache + RefUnwindSafe + Send + UnwindSafe + Sync>> is !null: UnsafeUnpin,
PhantomData<Pool<Cache, Box<dyn Fn() -> Cache + RefUnwindSafe + Send + UnwindSafe + Sync>>>: UnsafeUnpin,
*const ArcInner<[String]> is !null: UnsafeUnpin,
PhantomData<ArcInner<[String]>>: UnsafeUnpin,
PhantomData<Group>: UnsafeUnpin,
*mut sqlite3: UnsafeUnpin,
*const ArcInner<Mutex<*mut sqlite3>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Mutex<*mut sqlite3>>>: UnsafeUnpin,
PhantomData<NonNull<Node<Arc<str>, RawStatement>>>: UnsafeUnpin,
*const Node<Arc<str>, RawStatement> is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<(String, String)>: UnsafeUnpin,
*const LeafNode<ProcId, LineageEntry> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(ProcId, LineageEntry)>>: UnsafeUnpin,
*const LeafNode<String, (String, u64, u64)> is !null: UnsafeUnpin,
PhantomData<Box<(String, (String, u64, u64))>>: UnsafeUnpin,
PhantomData<(String, EventKind, u64, Option<String>)>: UnsafeUnpin,
PhantomData<Impression>: UnsafeUnpin,
*const LeafNode<String, (u64, u64)> is !null: UnsafeUnpin,
PhantomData<Box<(String, (u64, u64))>>: UnsafeUnpin,
PhantomData<(ProcId, u64)>: UnsafeUnpin,
PhantomData<(ProcId, (Option<u64>, Option<u64>))>: UnsafeUnpin,
PhantomData<(ProcId, ())>: UnsafeUnpin,
*const LeafNode<String, (u64, Option<EndedSession>)> is !null: UnsafeUnpin,
PhantomData<Box<(String, (u64, Option<EndedSession>))>>: UnsafeUnpin,
PhantomData<HistoryPoint>: UnsafeUnpin,
*const LeafNode<String, u16> is !null: UnsafeUnpin,
PhantomData<Box<(String, u16)>>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
PhantomData<PathBuf>: UnsafeUnpin,
PhantomData<ModelServer>: UnsafeUnpin,
PhantomData<Sandbox>: UnsafeUnpin,
PhantomData<u32>: UnsafeUnpin,
*const LeafNode<String, Series> is !null: UnsafeUnpin,
PhantomData<Box<(String, Series)>>: UnsafeUnpin,
*const LeafNode<String, CpuObs> is !null: UnsafeUnpin,
PhantomData<Box<(String, CpuObs)>>: UnsafeUnpin,
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> 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