pub struct IdFilter { /* private fields */ }Expand description
ID filter for single ID or mask-based matching
Supports both exact ID matching and mask-based matching.
§Example
use canlink_hal::filter::IdFilter;
// Exact match for ID 0x123
let filter = IdFilter::new(0x123);
// Mask match: matches 0x120-0x12F
let filter = IdFilter::with_mask(0x120, 0x7F0);Implementations§
Source§impl IdFilter
impl IdFilter
Sourcepub fn new_extended(id: u32) -> Self
pub fn new_extended(id: u32) -> Self
Sourcepub fn with_mask_extended(id: u32, mask: u32) -> Self
pub fn with_mask_extended(id: u32, mask: u32) -> Self
Create a new filter with mask for extended frame
Sourcepub fn try_new(id: u32) -> Result<Self, FilterError>
pub fn try_new(id: u32) -> Result<Self, FilterError>
Try to create a new filter, returning error if ID is invalid
§Errors
Returns FilterError::IdOutOfRange if id exceeds the maximum standard ID.
Sourcepub fn try_new_extended(id: u32) -> Result<Self, FilterError>
pub fn try_new_extended(id: u32) -> Result<Self, FilterError>
Try to create a new extended filter, returning error if ID is invalid
§Errors
Returns FilterError::IdOutOfRange if id exceeds the maximum extended ID.
Sourcepub fn set_hardware(&mut self, hardware: bool)
pub fn set_hardware(&mut self, hardware: bool)
Set whether this filter can use hardware acceleration
Sourcepub fn is_extended(&self) -> bool
pub fn is_extended(&self) -> bool
Check if this filter is for extended frames
Trait Implementations§
Auto Trait Implementations§
impl Freeze for IdFilter
impl RefUnwindSafe for IdFilter
impl Send for IdFilter
impl Sync for IdFilter
impl Unpin for IdFilter
impl UnsafeUnpin for IdFilter
impl UnwindSafe for IdFilter
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