pub struct SocketCan { /* private fields */ }Expand description
Classic CAN SocketCAN adapter implementing embedded-can-interface traits.
Implementations§
Source§impl SocketCan
impl SocketCan
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 as_inner_mut(&mut self) -> &mut CanSocket
pub fn as_inner_mut(&mut self) -> &mut CanSocket
Mutably borrow the inner SocketCAN socket.
Sourcepub fn into_inner(self) -> CanSocket
pub fn into_inner(self) -> CanSocket
Unwrap into the inner SocketCAN socket.
Trait Implementations§
Source§impl BlockingControl for SocketCan
impl BlockingControl for SocketCan
Source§impl FilterConfig for SocketCan
impl FilterConfig for SocketCan
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 SocketCan
impl RxFrameIo for SocketCan
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
Auto Trait Implementations§
impl Freeze for SocketCan
impl RefUnwindSafe for SocketCan
impl Send for SocketCan
impl Sync for SocketCan
impl Unpin for SocketCan
impl UnsafeUnpin for SocketCan
impl UnwindSafe for SocketCan
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