Struct socketcan::frame::CanRemoteFrame
source · pub struct CanRemoteFrame(/* private fields */);
Expand description
The classic CAN 2.0 frame with up to 8-bytes of data.
This is highly compatible with the can_frame
from libc.
(ref)
Implementations§
Trait Implementations§
source§impl AsPtr for CanRemoteFrame
impl AsPtr for CanRemoteFrame
source§impl AsRef<can_frame> for CanRemoteFrame
impl AsRef<can_frame> for CanRemoteFrame
source§impl Clone for CanRemoteFrame
impl Clone for CanRemoteFrame
source§fn clone(&self) -> CanRemoteFrame
fn clone(&self) -> CanRemoteFrame
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for CanRemoteFrame
impl Debug for CanRemoteFrame
source§impl Default for CanRemoteFrame
impl Default for CanRemoteFrame
source§impl Frame for CanRemoteFrame
impl Frame for CanRemoteFrame
source§fn set_id(&mut self, id: impl Into<Id>)
fn set_id(&mut self, id: impl Into<Id>)
Sets the CAN ID for the frame.
This will set the RTR flag in the CAN ID word.
source§fn set_data(&mut self, data: &[u8]) -> Result<(), ConstructionError>
fn set_data(&mut self, data: &[u8]) -> Result<(), ConstructionError>
Sets the data payload of the frame. For the Remote frame, this just updates the DLC to the length of the data slice.
source§fn from_raw_id(id: u32, data: &[u8]) -> Option<Self>
fn from_raw_id(id: u32, data: &[u8]) -> Option<Self>
Creates a frame using a raw, integer CAN ID. Read more
source§fn remote_from_raw_id(id: u32, dlc: usize) -> Option<Self>
fn remote_from_raw_id(id: u32, dlc: usize) -> Option<Self>
Creates a remote frame using a raw, integer CAN ID. Read more
source§fn is_error_frame(&self) -> bool
fn is_error_frame(&self) -> bool
Check if frame is an error message
source§impl Frame for CanRemoteFrame
impl Frame for CanRemoteFrame
source§fn new_remote(id: impl Into<Id>, dlc: usize) -> Option<Self>
fn new_remote(id: impl Into<Id>, dlc: usize) -> Option<Self>
Create a new remote transmission request frame.
This will set the RTR flag in the CAN ID word.
source§fn is_extended(&self) -> bool
fn is_extended(&self) -> bool
Check if frame uses 29-bit extended ID format.
source§fn is_remote_frame(&self) -> bool
fn is_remote_frame(&self) -> bool
Check if frame is a remote transmission request.
source§fn data(&self) -> &[u8] ⓘ
fn data(&self) -> &[u8] ⓘ
A slice into the actual data. Slice will always be <= 8 bytes in length
source§fn is_standard(&self) -> bool
fn is_standard(&self) -> bool
Returns true if this frame is a standard frame.
source§fn is_data_frame(&self) -> bool
fn is_data_frame(&self) -> bool
Returns true if this frame is a data frame.
source§impl From<CanRemoteFrame> for CanFrame
impl From<CanRemoteFrame> for CanFrame
source§fn from(frame: CanRemoteFrame) -> Self
fn from(frame: CanRemoteFrame) -> Self
Create a CanFrame
from a remote frame
source§impl TryFrom<can_frame> for CanRemoteFrame
impl TryFrom<can_frame> for CanRemoteFrame
source§impl UpperHex for CanRemoteFrame
impl UpperHex for CanRemoteFrame
impl Copy for CanRemoteFrame
Auto Trait Implementations§
impl RefUnwindSafe for CanRemoteFrame
impl Send for CanRemoteFrame
impl Sync for CanRemoteFrame
impl Unpin for CanRemoteFrame
impl UnwindSafe for CanRemoteFrame
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> ControllerSpecificErrorInformation for Twhere
T: Frame,
impl<T> ControllerSpecificErrorInformation for Twhere T: Frame,
source§fn get_ctrl_err(&self) -> Option<&[u8]>
fn get_ctrl_err(&self) -> Option<&[u8]>
Get the controller specific error information.