Skip to main content

Ctx

Struct Ctx 

Source
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

Source

pub fn new(global: GlobalOpts) -> Result<Self>

Source

pub fn config(&self) -> &Config

Source

pub fn paths(&self) -> ConfigPaths

Paths of the effective user config directory (moves with --config).

Source

pub fn units(&self) -> UnitSystem

Source

pub fn fmt(&self, b: u64) -> String

Bytes in the configured units and decimals.

Source

pub fn fmt_opt(&self, b: Option<u64>) -> String

Source

pub fn replaying(&self) -> bool

Source

pub fn state(&self) -> Option<StateDb>

The state store (none while replaying: a fixture must never write this machine’s journal).

Source

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.

Source

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 Ctx

§

impl Move for Ctx

§

impl RefUnwindSafe for Ctx

§

impl Send for Ctx
where 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 Ctx
where 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 Ctx
where *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 Ctx

§

impl UnwindSafe for Ctx

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.