Struct nmstate::Interfaces
source · #[non_exhaustive]pub struct Interfaces { /* private fields */ }
Expand description
Represent a list of Interface with special serde::Deserializer and serde::Serializer. When applying complex nested interface(e.g. bridge over bond over vlan of eth1), the supported maximum nest level is 4 like previous example. For 5+ nested level, you need to place controller interface before its ports.
Implementations§
source§impl Interfaces
impl Interfaces
sourcepub fn new() -> Self
pub fn new() -> Self
Create empty Interfaces.
pub fn is_empty(&self) -> bool
sourcepub fn get_iface<'a>(
&'a self,
iface_name: &str,
iface_type: InterfaceType
) -> Option<&'a Interface>
pub fn get_iface<'a>(
&'a self,
iface_name: &str,
iface_type: InterfaceType
) -> Option<&'a Interface>
Search interface base on interface name and interface type. When using InterfaceType::Unknown, we only search kernel interface(which has presentation in kernel space).
sourcepub fn set_up_priority(&mut self) -> Result<(), NmstateError>
pub fn set_up_priority(&mut self) -> Result<(), NmstateError>
TODO: this is internal function.
pub fn iter(&self) -> impl Iterator<Item = &Interface>
pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut Interface>
Trait Implementations§
source§impl Clone for Interfaces
impl Clone for Interfaces
source§fn clone(&self) -> Interfaces
fn clone(&self) -> Interfaces
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Interfaces
impl Debug for Interfaces
source§impl Default for Interfaces
impl Default for Interfaces
source§fn default() -> Interfaces
fn default() -> Interfaces
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for Interfaces
impl<'de> Deserialize<'de> for Interfaces
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
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 PartialEq<Interfaces> for Interfaces
impl PartialEq<Interfaces> for Interfaces
source§fn eq(&self, other: &Interfaces) -> bool
fn eq(&self, other: &Interfaces) -> bool
source§impl Serialize for Interfaces
impl Serialize for Interfaces
impl Eq for Interfaces
impl StructuralEq for Interfaces
impl StructuralPartialEq for Interfaces
Auto Trait Implementations§
impl RefUnwindSafe for Interfaces
impl Send for Interfaces
impl Sync for Interfaces
impl Unpin for Interfaces
impl UnwindSafe for Interfaces
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
source§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.