pub struct RangeFilter { /* private fields */ }Expand description
Range filter for matching a range of CAN IDs
Matches any message with an ID between start_id and end_id (inclusive).
§Example
use canlink_hal::filter::RangeFilter;
// Match IDs 0x100-0x1FF
let filter = RangeFilter::new(0x100, 0x1FF);Implementations§
Source§impl RangeFilter
impl RangeFilter
Sourcepub fn new_extended(start_id: u32, end_id: u32) -> Self
pub fn new_extended(start_id: u32, end_id: u32) -> Self
Sourcepub fn try_new(start_id: u32, end_id: u32) -> Result<Self, FilterError>
pub fn try_new(start_id: u32, end_id: u32) -> Result<Self, FilterError>
Try to create a new range filter, returning error if invalid
§Errors
Returns FilterError::InvalidRange if start_id > end_id.
Returns FilterError::IdOutOfRange if end_id exceeds the maximum standard ID.
Sourcepub fn try_new_extended(start_id: u32, end_id: u32) -> Result<Self, FilterError>
pub fn try_new_extended(start_id: u32, end_id: u32) -> Result<Self, FilterError>
Try to create a new extended range filter, returning error if invalid
§Errors
Returns FilterError::InvalidRange if start_id > end_id.
Returns FilterError::IdOutOfRange if end_id exceeds the maximum extended ID.
Sourcepub fn is_extended(&self) -> bool
pub fn is_extended(&self) -> bool
Check if this filter is for extended frames
Sourcepub fn range_size(&self) -> u32
pub fn range_size(&self) -> u32
Get the range size
Trait Implementations§
Source§impl Clone for RangeFilter
impl Clone for RangeFilter
Source§fn clone(&self) -> RangeFilter
fn clone(&self) -> RangeFilter
Returns a duplicate 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 RangeFilter
impl Debug for RangeFilter
Source§impl MessageFilter for RangeFilter
impl MessageFilter for RangeFilter
Auto Trait Implementations§
impl Freeze for RangeFilter
impl RefUnwindSafe for RangeFilter
impl Send for RangeFilter
impl Sync for RangeFilter
impl Unpin for RangeFilter
impl UnsafeUnpin for RangeFilter
impl UnwindSafe for RangeFilter
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