pub struct RawSocket(/* private fields */);
Expand description
Sends and receives messages over a SOCK_RAW.
Implementations§
Source§impl RawSocket
impl RawSocket
Sourcepub fn new() -> Result<RawSocket>
pub fn new() -> Result<RawSocket>
Returns a new RawSocket for sending and receiving messages on IPPROTO_ICMP over a SOCK_RAW. Currently only supports IPv4. TODO: use libc::IPPROTO* when the const becomes available, and add some config for IPv4/IPv6.
Sourcepub fn set_nonblocking(&self, nonblocking: bool) -> Result<()>
pub fn set_nonblocking(&self, nonblocking: bool) -> Result<()>
Sets the socket to non-blocking mode so that reads return immediately.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RawSocket
impl RefUnwindSafe for RawSocket
impl Send for RawSocket
impl Sync for RawSocket
impl Unpin for RawSocket
impl UnwindSafe for RawSocket
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