pub struct LinkSetRequest { /* private fields */ }

Implementations§

source§

impl LinkSetRequest

source

pub async fn execute(self) -> Result<(), Error>

Execute the request

source

pub fn message_mut(&mut self) -> &mut LinkMessage

Return a mutable reference to the request

source

pub fn master(self, ctrl_index: u32) -> Self

👎Deprecated since 0.14.0: Please use LinkSetRequest::controller() instead

Attach the link to a bridge (its master). This is equivalent to ip link set LINK master BRIDGE. To succeed, both the bridge and the link that is being attached must be UP.

To Remove a link from a bridge, set its master to zero. This is equvalent to ip link set LINK nomaster

source

pub fn controller(self, ctrl_index: u32) -> Self

Attach the link to a bridge (its controller). This is equivalent to ip link set LINK master BRIDGE. To succeed, both the bridge and the link that is being attached must be UP.

To Remove a link from a bridge, set its master to zero. This is equvalent to ip link set LINK nomaster

source

pub fn nomaster(self) -> Self

👎Deprecated since 0.14.0: Please use LinkSetRequest::nocontroller() instead

Detach the link from its master. This is equivalent to ip link set LINK nomaster. To succeed, the link that is being detached must be UP.

source

pub fn nocontroller(self) -> Self

Detach the link from its controller. This is equivalent to ip link set LINK nomaster. To succeed, the link that is being detached must be UP.

source

pub fn up(self) -> Self

Set the link with the given index up (equivalent to ip link set dev DEV up)

source

pub fn down(self) -> Self

Set the link with the given index down (equivalent to ip link set dev DEV down)

source

pub fn promiscuous(self, enable: bool) -> Self

Enable or disable promiscious mode of the link with the given index (equivalent to ip link set dev DEV promisc on/off)

source

pub fn arp(self, enable: bool) -> Self

Enable or disable the ARP protocol of the link with the given index (equivalent to ip link set dev DEV arp on/off)

source

pub fn name(self, name: String) -> Self

Set the name of the link with the given index (equivalent to ip link set DEV name NAME)

source

pub fn mtu(self, mtu: u32) -> Self

Set the mtu of the link with the given index (equivalent to ip link set DEV mtu MTU)

source

pub fn address(self, address: Vec<u8>) -> Self

Set the hardware address of the link with the given index (equivalent to ip link set DEV address ADDRESS)

source

pub fn setns_by_pid(self, pid: u32) -> Self

Move this network device into the network namespace of the process with the given pid.

source

pub fn setns_by_fd(self, fd: RawFd) -> Self

Move this network device into the network namespace corresponding to the given file descriptor.

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> 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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.