pub struct Socket { /* private fields */ }
Expand description
Netlink Socket can be used to communicate with the Linux kernel using the netlink protocol.
Implementations§
Source§impl Socket
impl Socket
Sourcepub fn new_multicast(protocol: Protocol, groups: u32) -> Result<Socket>
pub fn new_multicast(protocol: Protocol, groups: u32) -> Result<Socket>
Create a new Socket which subscribes to the provided multi-cast groups
Sourcepub fn multicast_group_subscribe(&mut self, group: u32) -> Result<()>
pub fn multicast_group_subscribe(&mut self, group: u32) -> Result<()>
Subscribe to the multi-cast group provided
Sourcepub fn send_message<S: Sendable>(&mut self, payload: &S) -> Result<usize>
pub fn send_message<S: Sendable>(&mut self, payload: &S) -> Result<usize>
Send the provided package on the socket
Sourcepub fn receive_messages(&mut self) -> Result<Vec<Message>>
pub fn receive_messages(&mut self) -> Result<Vec<Message>>
Receive Messages pending on the socket
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Socket
impl RefUnwindSafe for Socket
impl Send for Socket
impl Sync for Socket
impl Unpin for Socket
impl UnwindSafe for Socket
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