Skip to main content

SourceKind

Struct SourceKind 

Source
pub struct SourceKind(/* private fields */);
Expand description

A kind of place a value can come from.

Deliberately open: usage knows about the command line, the environment, files and declared defaults, and every CLI in the fleet has at least one kind it reads itself — a git config, a pkl file, an .npmrc. Those declare a source in the spec and pass their own kind here.

Implementations§

Source§

impl SourceKind

Source

pub const CLI: Self

The command line.

Source

pub const ENV: Self

The environment.

Source

pub const FILE: Self

A configuration file usage read itself.

Source

pub const DEFAULTS: Self

The default the spec declares.

Source

pub const COERCED: Self

A value the CLI rewrote after merging — mise’s raw implying jobs = 1.

Its own kind so explain never claims a file said something it did not. A rewrite that looked like it came from wherever the original value did is how a user ends up editing a file that has nothing to do with the value they are seeing.

Source

pub const fn new(name: &'static str) -> Self

Source

pub const fn name(self) -> &'static str

Trait Implementations§

Source§

impl Clone for SourceKind

Source§

fn clone(&self) -> SourceKind

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for SourceKind

Source§

impl Debug for SourceKind

Source§

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

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

impl Eq for SourceKind

Source§

impl PartialEq for SourceKind

Source§

fn eq(&self, other: &SourceKind) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for SourceKind

Auto Trait Implementations§

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, 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.