Skip to main content

KnobSource

Enum KnobSource 

Source
#[repr(u32)]
pub enum KnobSource { NotRecorded = 0, Default = 1, Derived = 2, Kconfig = 3, Environment = 4, Snippet = 5, CommandLine = 6, }
Expand description

Which rung of the knob ladder decided a knob the record carries.

Issue 1549. A knob’s VALUE says what the image was built with; this says who decided it, which is the half a reader needs before changing it: a derived value is fixed by editing the declaration it came from, a stated one by editing the statement. Spelled once, here, and packed into the upper bits of each knob word that carries one (see the field docs). zephyr/cmake/nros_cargo_build.cmake records the rung as NROS_KNOB_SOURCE_<knob>; build.rs maps its spelling onto this.

Variants§

§

NotRecorded = 0

No resolver road reached this build (a cargo-only lane), so the record cannot say. The value next to it is NOT evidence of anything.

§

Default = 1

Nobody stated it and nothing derived it: the consumer’s own default.

§

Derived = 2

Derived from the image’s entity inventory.

§

Kconfig = 3

Stated in Kconfig (a .conf fragment, a snippet, or its default).

§

Environment = 4

Stated in the environment, which outranks everything: the build’s for a compile-time knob, ROS_DOMAIN_ID at run time for a hosted image’s domain.

§

Snippet = 5

Stated by a Zephyr snippet’s Kconfig fragment (-S <snippet>), issue 1550: a transport snippet is where an image that varies its link tends to state its domain, and where one that forgets to is invisible.

§

CommandLine = 6

Stated on the cmake / west command line (-DCONFIG_<symbol>=<n>).

Implementations§

Source§

impl KnobSource

Source

pub const fn from_code(code: u32) -> Self

The variant build.rs encoded as code, or KnobSource::NotRecorded for a number this crate does not know.

Trait Implementations§

Source§

impl Clone for KnobSource

Source§

fn clone(&self) -> KnobSource

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 KnobSource

Source§

impl Debug for KnobSource

Source§

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

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

impl Eq for KnobSource

Source§

impl PartialEq for KnobSource

Source§

fn eq(&self, other: &KnobSource) -> 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 KnobSource

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.