pub struct SocketCanFd { /* private fields */ }Expand description
CAN-FD SocketCAN adapter implementing embedded-can-interface traits.
Implementations§
Source§impl SocketCanFd
impl SocketCanFd
Sourcepub fn open(iface: &str) -> Result<Self, SocketcanError>
pub fn open(iface: &str) -> Result<Self, SocketcanError>
Open a SocketCAN interface by name (e.g. "can0").
Sourcepub fn new(inner: CanFdSocket) -> Self
pub fn new(inner: CanFdSocket) -> Self
Wrap an existing socketcan::CanFdSocket.
Sourcepub fn as_inner(&self) -> &CanFdSocket
pub fn as_inner(&self) -> &CanFdSocket
Borrow the inner SocketCAN socket.
Sourcepub fn as_inner_mut(&mut self) -> &mut CanFdSocket
pub fn as_inner_mut(&mut self) -> &mut CanFdSocket
Mutably borrow the inner SocketCAN socket.
Sourcepub fn into_inner(self) -> CanFdSocket
pub fn into_inner(self) -> CanFdSocket
Unwrap into the inner SocketCAN socket.
Trait Implementations§
Source§impl AsRawFd for SocketCanFd
impl AsRawFd for SocketCanFd
Source§impl BlockingControl for SocketCanFd
impl BlockingControl for SocketCanFd
Source§impl Debug for SocketCanFd
impl Debug for SocketCanFd
Source§impl FilterConfig for SocketCanFd
impl FilterConfig for SocketCanFd
Source§type FiltersHandle<'a> = ()
where
Self: 'a
type FiltersHandle<'a> = () where Self: 'a
Handle used for modifying filters in-place (e.g. a bank accessor). Read more
Source§fn set_filters(&mut self, filters: &[IdMaskFilter]) -> Result<(), Self::Error>
fn set_filters(&mut self, filters: &[IdMaskFilter]) -> Result<(), Self::Error>
Replace the current filter configuration with a list of ID/mask pairs. Read more
Source§fn modify_filters(&mut self) -> Self::FiltersHandle<'_>
fn modify_filters(&mut self) -> Self::FiltersHandle<'_>
Access filter banks through a handle (optional ergonomic API).
Source§impl RxFrameIo for SocketCanFd
impl RxFrameIo for SocketCanFd
Source§type Frame = CanAnyFrame
type Frame = CanAnyFrame
The CAN frame type.
Source§fn recv(&mut self) -> Result<Self::Frame, Self::Error>
fn recv(&mut self) -> Result<Self::Frame, Self::Error>
Receive a frame, blocking until one is available.
Source§fn try_recv(&mut self) -> Result<Self::Frame, Self::Error>
fn try_recv(&mut self) -> Result<Self::Frame, Self::Error>
Attempt to receive a frame without blocking. Read more
Source§impl TxFrameIo for SocketCanFd
impl TxFrameIo for SocketCanFd
Source§type Frame = CanAnyFrame
type Frame = CanAnyFrame
The CAN frame type. Read more
Source§fn send(&mut self, frame: &Self::Frame) -> Result<(), Self::Error>
fn send(&mut self, frame: &Self::Frame) -> Result<(), Self::Error>
Send a frame, blocking until it is accepted by the driver.
Auto Trait Implementations§
impl Freeze for SocketCanFd
impl RefUnwindSafe for SocketCanFd
impl Send for SocketCanFd
impl Sync for SocketCanFd
impl Unpin for SocketCanFd
impl UnsafeUnpin for SocketCanFd
impl UnwindSafe for SocketCanFd
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more