#[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 based on interface name and interface type. When using InterfaceType::Unknown, we only search kernel interface(which has presentation in kernel space).
pub fn remove_iface( &mut self, iface_name: &str, iface_type: InterfaceType, ) -> Option<Interface>
pub fn iter(&self) -> impl Iterator<Item = &Interface>
pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut Interface>
Source§impl Interfaces
impl Interfaces
Trait Implementations§
Source§impl Clone for Interfaces
impl Clone for Interfaces
Source§fn clone(&self) -> Interfaces
fn clone(&self) -> Interfaces
Returns a duplicate 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 for Interfaces
impl PartialEq for Interfaces
Source§impl Serialize for Interfaces
impl Serialize for Interfaces
impl Eq for Interfaces
impl StructuralPartialEq for Interfaces
Auto Trait Implementations§
impl Freeze for Interfaces
impl RefUnwindSafe for Interfaces
impl Send for Interfaces
impl Sync for Interfaces
impl Unpin for Interfaces
impl UnwindSafe for Interfaces
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.