Ctx

Struct Ctx 

Source
pub struct Ctx {
Show 18 fields pub flight_ctx: LateInit<FlightCtx>, pub formation_ctx: LateInit<FormationCtx>, pub md_ctx: LateInit<MetadataCtx>, pub locks_ctx: LateInit<LocksCtx>, pub restrict_ctx: LateInit<RestrictCtx>, pub conf_files: Vec<PathBuf>, pub args: Args, pub db: Db, pub internal_run: bool, pub did_init: bool, pub disable_pb: bool, pub registry: String, pub compute_url: Option<Url>, pub identity_url: Option<Url>, pub metadata_url: Option<Url>, pub locks_url: Option<Url>, pub insecure_urls: bool, pub invalid_certs: bool, /* private fields */
}
Expand description

The source of truth “Context” that is passed to all runtime processes to make decisions based on user configuration

Fields§

§flight_ctx: LateInit<FlightCtx>

Context relate to exclusively to Flight operations and commands

§formation_ctx: LateInit<FormationCtx>

Context relate to exclusively to Formation operations and commands

§md_ctx: LateInit<MetadataCtx>

Context relate to exclusively to key-value operations and commands

§locks_ctx: LateInit<LocksCtx>

Context relate to exclusively to Locks operations and commands

§restrict_ctx: LateInit<RestrictCtx>

Context relate to exclusively to Restrict operations and commands

§conf_files: Vec<PathBuf>

Where the configuration files were loaded from

§args: Args

Common CLI arguments

§db: Db

The in memory databases

§internal_run: bool

Allows tracking if we’re running a command internally and skippy certain checks or output

§did_init: bool

Did we run initialization automatically or not on startup?

§disable_pb: bool

Disable progress bar indicators

§registry: String

The container image registry to infer if not provided

§compute_url: Option<Url>

Set the base URL for the request

§identity_url: Option<Url>§metadata_url: Option<Url>§locks_url: Option<Url>§insecure_urls: bool§invalid_certs: bool

Implementations§

Source§

impl Ctx

Source

pub fn update_from_env(&mut self) -> Result<()>

Source

pub fn data_dir(&self) -> &Path

Source

pub fn conf_files(&self) -> &[PathBuf]

Source

pub fn flights_file(&self) -> PathBuf

Source

pub fn formations_file(&self) -> PathBuf

Source

pub fn persist_formations(&self) -> Result<()>

Write out an entirely new JSON file if --stateless wasn’t used

Source

pub fn persist_flights(&self) -> Result<()>

Write out an entirely new JSON file if --stateless wasn’t used

Trait Implementations§

Source§

impl Clone for Ctx

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Ctx

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Ctx

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl From<RawConfig> for Ctx

Source§

fn from(cfg: RawConfig) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl !Freeze for Ctx

§

impl RefUnwindSafe for Ctx

§

impl Send for Ctx

§

impl !Sync for Ctx

§

impl Unpin 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,