pub struct Ctx {
pub global: GlobalOpts,
pub opts: LoadOptions,
pub loaded: Loaded,
pub no_learn: bool,
}Fields§
§global: GlobalOpts§opts: LoadOptions§loaded: Loaded§no_learn: bool--no-learn, OOMTOP_NO_LEARN=1 or personalization.learn = false.
Implementations§
Source§impl Ctx
impl Ctx
pub fn new(global: GlobalOpts) -> Result<Self>
pub fn config(&self) -> &Config
Sourcepub fn paths(&self) -> ConfigPaths
pub fn paths(&self) -> ConfigPaths
Paths of the effective user config directory (moves with --config).
pub fn units(&self) -> UnitSystem
pub fn fmt_opt(&self, b: Option<u64>) -> String
pub fn replaying(&self) -> bool
Sourcepub fn state(&self) -> Option<StateDb>
pub fn state(&self) -> Option<StateDb>
The state store (none while replaying: a fixture must never write this machine’s journal).
Sourcepub fn engine(&self, on_demand: bool) -> Result<Engine>
pub fn engine(&self, on_demand: bool) -> Result<Engine>
The pipeline: live sampling of this machine, or --replay FIXTURE. on_demand = two samples 150 ms
apart per snapshot (one-shot commands and MCP), so CPU % and rates are real.
Sourcepub fn engine_read_only(&self, on_demand: bool) -> Result<Engine>
pub fn engine_read_only(&self, on_demand: bool) -> Result<Engine>
Like Ctx::engine, for commands that must leave no trace (reclaim --dry-run): an existing state
store is read for the lineage journal — so the plan is the one a real run would make — and never
written; when there is none, none is created.
Auto Trait Implementations§
impl Forget for Ctx
impl Freeze for Ctxwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<String>: Freeze,
PhantomData<(String, String)>: Freeze,
*const LeafNode<String, u16> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, u16)>>: Freeze,
*const LeafNode<String, String> is !null: Freeze,
PhantomData<Box<(String, String)>>: Freeze,
PhantomData<SavedView>: Freeze,
*const LeafNode<String, Origin> is !null: Freeze,
PhantomData<Box<(String, Origin)>>: Freeze,
PhantomData<PathBuf>: Freeze,
PhantomData<ConfigError>: Freeze,
*const LeafNode<String, Value> is !null: Freeze,
PhantomData<Box<(String, Value)>>: Freeze,
*const LeafNode<String, usize> is !null: Freeze,
PhantomData<Box<(String, usize)>>: Freeze,
*const LeafNode<String, Vec<Origin>> is !null: Freeze,
PhantomData<Box<(String, Vec<Origin>)>>: Freeze,
impl Move for Ctx
impl RefUnwindSafe for Ctx
impl Send for Ctxwhere
RawVecInner: Send,
NodeRef<Owned, String, u16, LeafOrInternal>: Send,
BoxRaw<(String, u16)>: Send,
NodeRef<Owned, String, String, LeafOrInternal>: Send,
BoxRaw<(String, String)>: Send,
NodeRef<Owned, String, Origin, LeafOrInternal>: Send,
BoxRaw<(String, Origin)>: Send,
NodeRef<Owned, String, Value, LeafOrInternal>: Send,
BoxRaw<(String, Value)>: Send,
NodeRef<Owned, String, usize, LeafOrInternal>: Send,
BoxRaw<(String, usize)>: Send,
NodeRef<Owned, String, Vec<Origin>, LeafOrInternal>: Send,
BoxRaw<(String, Vec<Origin>)>: Send,
impl Sync for Ctxwhere
RawVecInner: Sync,
NodeRef<Owned, String, u16, LeafOrInternal>: Sync,
BoxRaw<(String, u16)>: Sync,
NodeRef<Owned, String, String, LeafOrInternal>: Sync,
BoxRaw<(String, String)>: Sync,
NodeRef<Owned, String, Origin, LeafOrInternal>: Sync,
BoxRaw<(String, Origin)>: Sync,
NodeRef<Owned, String, Value, LeafOrInternal>: Sync,
BoxRaw<(String, Value)>: Sync,
NodeRef<Owned, String, usize, LeafOrInternal>: Sync,
BoxRaw<(String, usize)>: Sync,
NodeRef<Owned, String, Vec<Origin>, LeafOrInternal>: Sync,
BoxRaw<(String, Vec<Origin>)>: Sync,
impl Unpin for Ctxwhere
*const u8 is !null: Unpin,
*const LeafNode<String, u16> is !null: Unpin,
Box<(String, u16)>: Unpin,
*const LeafNode<String, String> is !null: Unpin,
Box<(String, String)>: Unpin,
*const LeafNode<String, Origin> is !null: Unpin,
Box<(String, Origin)>: Unpin,
*const LeafNode<String, Value> is !null: Unpin,
Box<(String, Value)>: Unpin,
*const LeafNode<String, usize> is !null: Unpin,
Box<(String, usize)>: Unpin,
*const LeafNode<String, Vec<Origin>> is !null: Unpin,
Box<(String, Vec<Origin>)>: Unpin,
impl UnsafeUnpin for Ctxwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
PhantomData<(String, String)>: UnsafeUnpin,
*const LeafNode<String, u16> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, u16)>>: UnsafeUnpin,
*const LeafNode<String, String> is !null: UnsafeUnpin,
PhantomData<Box<(String, String)>>: UnsafeUnpin,
PhantomData<SavedView>: UnsafeUnpin,
*const LeafNode<String, Origin> is !null: UnsafeUnpin,
PhantomData<Box<(String, Origin)>>: UnsafeUnpin,
PhantomData<PathBuf>: UnsafeUnpin,
PhantomData<ConfigError>: UnsafeUnpin,
*const LeafNode<String, Value> is !null: UnsafeUnpin,
PhantomData<Box<(String, Value)>>: UnsafeUnpin,
*const LeafNode<String, usize> is !null: UnsafeUnpin,
PhantomData<Box<(String, usize)>>: UnsafeUnpin,
*const LeafNode<String, Vec<Origin>> is !null: UnsafeUnpin,
PhantomData<Box<(String, Vec<Origin>)>>: UnsafeUnpin,
impl UnwindSafe for Ctxwhere
RawVecInner: UnwindSafe,
BTreeMap<String, u16>: UnwindSafe,
BTreeMap<String, String>: UnwindSafe,
BTreeMap<String, Origin>: UnwindSafe,
BTreeMap<String, Value>: UnwindSafe,
BTreeMap<String, usize>: UnwindSafe,
BTreeMap<String, Vec<Origin>>: UnwindSafe,
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
Mutably borrows from an owned value. Read more
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> ⓘ
Converts
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> ⓘ
Converts
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