Struct socketcan_isotp::IsoTpSocket
source · [−]pub struct IsoTpSocket { /* private fields */ }Expand description
An ISO-TP socketcan socket.
Will be closed upon deallocation. To close manually, use std::drop::Drop.
Internally this is just a wrapped file-descriptor.
Implementations
sourceimpl IsoTpSocket
impl IsoTpSocket
sourcepub fn open(
ifname: &str,
src: impl Into<Id>,
dst: impl Into<Id>
) -> Result<Self, Error>
pub fn open(
ifname: &str,
src: impl Into<Id>,
dst: impl Into<Id>
) -> Result<Self, Error>
Open a named CAN ISO-TP device.
Usually the more common case, opens a socket can device by name, such as “vcan0” or “socan0”.
sourcepub fn open_with_opts(
ifname: &str,
src: impl Into<Id>,
dst: impl Into<Id>,
isotp_options: Option<IsoTpOptions>,
rx_flow_control_options: Option<FlowControlOptions>,
link_layer_options: Option<LinkLayerOptions>
) -> Result<Self, Error>
pub fn open_with_opts(
ifname: &str,
src: impl Into<Id>,
dst: impl Into<Id>,
isotp_options: Option<IsoTpOptions>,
rx_flow_control_options: Option<FlowControlOptions>,
link_layer_options: Option<LinkLayerOptions>
) -> Result<Self, Error>
Open a named CAN ISO-TP device, passing additional options.
Usually the more common case, opens a socket can device by name, such as “vcan0” or “socan0”.
sourcepub fn open_if(
if_index: c_int,
src: impl Into<Id>,
dst: impl Into<Id>
) -> Result<Self, Error>
pub fn open_if(
if_index: c_int,
src: impl Into<Id>,
dst: impl Into<Id>
) -> Result<Self, Error>
Open CAN ISO-TP device device by interface number.
Opens a CAN device by kernel interface number.
sourcepub fn open_if_with_opts(
if_index: c_int,
src: impl Into<Id>,
dst: impl Into<Id>,
isotp_options: Option<IsoTpOptions>,
rx_flow_control_options: Option<FlowControlOptions>,
link_layer_options: Option<LinkLayerOptions>
) -> Result<Self, Error>
pub fn open_if_with_opts(
if_index: c_int,
src: impl Into<Id>,
dst: impl Into<Id>,
isotp_options: Option<IsoTpOptions>,
rx_flow_control_options: Option<FlowControlOptions>,
link_layer_options: Option<LinkLayerOptions>
) -> Result<Self, Error>
Open CAN ISO-TP device device by interface number, passing additional options.
Opens a CAN device by kernel interface number.
sourcepub fn set_nonblocking(&self, nonblocking: bool) -> Result<()>
pub fn set_nonblocking(&self, nonblocking: bool) -> Result<()>
Change socket to non-blocking mode
Trait Implementations
sourceimpl AsRawFd for IsoTpSocket
impl AsRawFd for IsoTpSocket
sourceimpl Drop for IsoTpSocket
impl Drop for IsoTpSocket
sourceimpl FromRawFd for IsoTpSocket
impl FromRawFd for IsoTpSocket
sourceunsafe fn from_raw_fd(fd: RawFd) -> Self
unsafe fn from_raw_fd(fd: RawFd) -> Self
Constructs a new instance of Self from the given raw file
descriptor. Read more
sourceimpl IntoRawFd for IsoTpSocket
impl IntoRawFd for IsoTpSocket
sourcefn into_raw_fd(self) -> RawFd
fn into_raw_fd(self) -> RawFd
Consumes this object, returning the raw underlying file descriptor. Read more
Auto Trait Implementations
impl RefUnwindSafe for IsoTpSocket
impl Send for IsoTpSocket
impl Sync for IsoTpSocket
impl Unpin for IsoTpSocket
impl UnwindSafe for IsoTpSocket
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