pub struct Netlink<C: NetlinkContext> { /* private fields */ }Expand description
The implementation of the Netlink protocol suite.
Implementations§
Source§impl<C: NetlinkContext> Netlink<C>
impl<C: NetlinkContext> Netlink<C>
Sourcepub fn new<H: InterfacesHandler>(
interfaces_handler: H,
) -> (Self, NetlinkWorkerParams<H, C>)
pub fn new<H: InterfacesHandler>( interfaces_handler: H, ) -> (Self, NetlinkWorkerParams<H, C>)
Returns a newly instantiated Netlink and parameters used to start the
asynchronous worker.
Caller is expected to run the worker by calling run_netlink_worker().
Sourcepub fn write_accept_ra_rt_table(
&self,
interface: SysctlInterfaceSelector,
value: i32,
) -> Result<(), SysctlError>
pub fn write_accept_ra_rt_table( &self, interface: SysctlInterfaceSelector, value: i32, ) -> Result<(), SysctlError>
Writes the accept_ra_rt_table sysctl for the selected interface.
Sourcepub fn read_accept_ra_rt_table(
&self,
interface: SysctlInterfaceSelector,
) -> Result<i32, SysctlError>
pub fn read_accept_ra_rt_table( &self, interface: SysctlInterfaceSelector, ) -> Result<i32, SysctlError>
Reads the accept_ra_rt_table sysctl for the selected interface.
Sourcepub fn new_route_client(
&self,
sender: C::Sender<RouteNetlinkMessage>,
receiver: C::Receiver<RouteNetlinkMessage>,
) -> Result<NetlinkRouteClient, NewClientError>
pub fn new_route_client( &self, sender: C::Sender<RouteNetlinkMessage>, receiver: C::Receiver<RouteNetlinkMessage>, ) -> Result<NetlinkRouteClient, NewClientError>
Creates a new client of the NETLINK_ROUTE protocol family.
sender is used by Netlink to send messages to the client.
receiver is used by Netlink to receive messages from the client.
Closing the receiver will close this client, disconnecting sender.
Auto Trait Implementations§
impl<C> !Freeze for Netlink<C>
impl<C> !RefUnwindSafe for Netlink<C>
impl<C> Send for Netlink<C>
impl<C> Sync for Netlink<C>
impl<C> Unpin for Netlink<C>
impl<C> !UnwindSafe for Netlink<C>
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, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
Converts the given service transport handle of type
T to [Self]§impl<T> IntoAny for T
impl<T> IntoAny for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T, U> TryIntoExt<U> for Twhere
U: TryFromExt<T>,
impl<T, U> TryIntoExt<U> for Twhere
U: TryFromExt<T>,
type Error = <U as TryFromExt<T>>::Error
Source§fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>
fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>
Tries to perform the conversion.