Skip to main content

BootParameters

Struct BootParameters 

Source
pub struct BootParameters {
    pub hosts: Vec<String>,
    pub macs: Option<Vec<String>>,
    pub nids: Option<Vec<u32>>,
    pub params: String,
    pub kernel: String,
    pub initrd: String,
    pub cloud_init: Option<Value>,
}

Fields§

§hosts: Vec<String>§macs: Option<Vec<String>>§nids: Option<Vec<u32>>§params: String§kernel: String§initrd: String§cloud_init: Option<Value>

Implementations§

Source§

impl BootParameters

Source

pub fn get_boot_image(&self) -> String

Returns the image id. This function may fail since it assumes kernel path has the following

Source

pub fn update_boot_image(&mut self, new_image_id: &str) -> Result<bool, Error>

Update boot image in kernel boot parameters and also in kernel and initrd fields if exists. Otherwise nothing is changed. This method updates both kernel params related to NCN and also CN Returns a boolean that indicates if kernel parameters have change:

  • kernel parameter value changed
  • number of kernel parameters have changed
Source

pub fn get_kernel_param_value(&self, key: &str) -> Option<String>

Source

pub fn get_num_kernel_params(&self) -> usize

Source

pub fn apply_kernel_params(&mut self, new_params: &str) -> bool

Apply a str of kernel parameters:

  • current kernel params will be ignored/removed and replaced by the new ones Returns true if kernel params have change
Source

pub fn update_kernel_params(&mut self, new_params: &str) -> bool

Set a str of kernel parameters:

  • if kernel parameter already exists, then it will be updated
  • if kernel parameter does not exists, then it will be added Returns true if kernel params have change
Source

pub fn update_kernel_param(&mut self, new_key: &str, new_value: &str) -> bool

Update kernel parameter. If kernel parameter exists, then it will be updated with new Note: This function won’t make any change to params without values (eg: ‘quiet’) since they don’t have values value. otherwise nothing will change

Source

pub fn add_kernel_params(&mut self, new_kernel_params: &str) -> bool

Add a kernel parameter:

  • if kernel parameter does not exists, then it will be added, otherwise nothing will change Returns true if kernel params have change
Source

pub fn delete_kernel_params(&mut self, kernel_params_to_delete: &str) -> bool

Delete kernel parameter. If kernel parameter exists, then it will be removed, otherwise nothing will be changed It accepts kernel params in format ‘key=value’ or just ‘key’ Returns true if kernel params have change

Trait Implementations§

Source§

impl Clone for BootParameters

Source§

fn clone(&self) -> BootParameters

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 Debug for BootParameters

Source§

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

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

impl Default for BootParameters

Source§

fn default() -> BootParameters

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

impl<'de> Deserialize<'de> for BootParameters

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl From<BootParameters> for BootParameters

Source§

fn from(value: FrontEndBootParameters) -> Self

Converts to this type from the input type.
Source§

impl Into<BootParameters> for BootParameters

Source§

fn into(self) -> FrontEndBootParameters

Converts this type into the (usually inferred) input type.
Source§

impl Serialize for BootParameters

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

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

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> 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<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

Source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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