pub enum UdevSocket {
SocketAddrV4(SocketAddrV4),
SocketAddrV6(SocketAddrV6),
Unix(UnixStream),
Netlink(sockaddr_nl),
Physical(sockaddr_ll),
}Expand description
Represents socket variants on a Linux system.
Variants§
SocketAddrV4(SocketAddrV4)
SocketAddrV6(SocketAddrV6)
Unix(UnixStream)
Netlink(sockaddr_nl)
Physical(sockaddr_ll)
Implementations§
Source§impl UdevSocket
impl UdevSocket
Sourcepub fn new_nl(family: i32, pid: u32, groups: u32) -> Self
pub fn new_nl(family: i32, pid: u32, groups: u32) -> Self
Creates a new UdevSocket for a sockaddr_nl Netlink socket type.
Sourcepub fn as_nl(&self) -> Result<&sockaddr_nl>
pub fn as_nl(&self) -> Result<&sockaddr_nl>
Gets the UdevSocket as a reference to a sockaddr_nl.
Returns Err(Error) if not a UdevSocket::Netlink variant.
Sourcepub fn as_nl_mut(&mut self) -> Result<&mut sockaddr_nl>
pub fn as_nl_mut(&mut self) -> Result<&mut sockaddr_nl>
Gets the UdevSocket as a mutable reference to a sockaddr_nl.
Returns Err(Error) if not a UdevSocket::Netlink variant.
Sourcepub fn as_nl_ptr(&self) -> Result<*const sockaddr_nl>
pub fn as_nl_ptr(&self) -> Result<*const sockaddr_nl>
Gets the UdevSocket as a const pointer to a sockaddr_nl.
Returns Err(Error) if not a UdevSocket::Netlink variant.
Sourcepub fn as_nl_ptr_mut(&mut self) -> Result<*mut sockaddr_nl>
pub fn as_nl_ptr_mut(&mut self) -> Result<*mut sockaddr_nl>
Gets the UdevSocket as a const pointer to a sockaddr_nl.
Returns Err(Error) if not a UdevSocket::Netlink variant.
Auto Trait Implementations§
impl Freeze for UdevSocket
impl RefUnwindSafe for UdevSocket
impl Send for UdevSocket
impl Sync for UdevSocket
impl Unpin for UdevSocket
impl UnwindSafe for UdevSocket
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