Struct socketcan_hal::CanInterface
source · [−]pub struct CanInterface { /* private fields */ }Expand description
SocketCAN interface
Controlled through the kernel’s Netlink interface, CAN devices can be brought up or down or configured through this.
Implementations
sourceimpl CanInterface
impl CanInterface
sourcepub fn open(ifname: &str) -> Result<Self, Error>
pub fn open(ifname: &str) -> Result<Self, Error>
Open CAN interface by name
Similar to open_if, but looks up the device by name instead
sourcepub fn open_iface(if_index: u32) -> Self
pub fn open_iface(if_index: u32) -> Self
Open CAN interface
Creates a new CanInterface instance. No actual “opening” is necessary
or performed when calling this function.
sourcepub fn bring_down(&self) -> Result<(), NlError>
pub fn bring_down(&self) -> Result<(), NlError>
Bring down CAN interface
Use a netlink control socket to set the interface status to “down”.
Auto Trait Implementations
impl RefUnwindSafe for CanInterface
impl Send for CanInterface
impl Sync for CanInterface
impl Unpin for CanInterface
impl UnwindSafe for CanInterface
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more