Skip to main content

Chosen

Struct Chosen 

Source
pub struct Chosen<'a> { /* private fields */ }
Expand description

The /chosen node containing boot parameters.

This node contains system configuration parameters chosen by the firmware or bootloader, such as boot arguments, console paths, and other boot-time settings.

Implementations§

Source§

impl<'a> Chosen<'a>

Source

pub fn bootargs(&self) -> Option<&'a str>

Returns the bootargs property value.

This property contains command-line arguments to be passed to the operating system kernel.

Source

pub fn stdout_path(&self) -> Option<&'a str>

Returns the stdout-path property value.

This property specifies the path to the device to be used for standard output (console).

Source

pub fn stdin_path(&self) -> Option<&'a str>

Returns the stdin-path property value.

This property specifies the path to the device to be used for standard input.

Methods from Deref<Target = NodeBase<'a>>§

Source

pub fn name(&self) -> &'a str

Returns the node’s name.

Source

pub fn level(&self) -> usize

Returns the depth/level of this node in the tree.

Source

pub fn properties(&self) -> PropIter<'a>

Returns an iterator over this node’s properties.

Source

pub fn find_property(&self, name: &str) -> Option<Property<'a>>

Finds a property by name.

Source

pub fn find_property_str(&self, name: &str) -> Option<&'a str>

Finds a string property by name.

Source

pub fn reg(&self) -> Option<RegIter<'a>>

Finds and parses the reg property, returning a Reg iterator.

Source

pub fn reg_array<const N: usize>(&self) -> Vec<RegInfo, N>

Finds and parses the reg property, returning all RegInfo entries.

Source

pub fn ranges(&self) -> Option<VecRange<'a>>

Returns the ranges property if present.

Source

pub fn compatibles(&self) -> impl Iterator<Item = &'a str>

Returns an iterator over compatible strings.

Source

pub fn path(&self) -> String<256>

Returns the full path of this node as a string.

For the root node, returns “/”. For other nodes, returns the absolute path like “/soc/serial@0”.

Trait Implementations§

Source§

impl<'a> Clone for Chosen<'a>

Source§

fn clone(&self) -> Chosen<'a>

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 Chosen<'_>

Source§

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

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

impl<'a> Deref for Chosen<'a>

Source§

type Target = NodeBase<'a>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.

Auto Trait Implementations§

§

impl<'a> Freeze for Chosen<'a>

§

impl<'a> RefUnwindSafe for Chosen<'a>

§

impl<'a> Send for Chosen<'a>

§

impl<'a> Sync for Chosen<'a>

§

impl<'a> Unpin for Chosen<'a>

§

impl<'a> UnwindSafe for Chosen<'a>

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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.