pub struct SingleExtendedFilter { /* private fields */ }Expand description
Warning: This is not a perfect filter. Standard IDs that match the bit layout of this filter will also be accepted.
Implementations§
Source§impl SingleExtendedFilter
impl SingleExtendedFilter
Sourcepub const fn new(id: &BitFilter<29>, rtr: &BitFilter<1>) -> Self
pub const fn new(id: &BitFilter<29>, rtr: &BitFilter<1>) -> Self
Create a filter that matches against a single 29-bit extended id.
The filter can match against the packet’s id and the RTR bit.
§Examples
A filter matching any odd extended IDs, with any rtr value.
ⓘ
const FILTER: twai::filter::SingleExtendedFilter =
twai::filter::SingleExtendedFilter::new(b"xxxxxxxxxxxxxxxxxxxxxxxxxxxx1", b"x");Sourcepub fn new_from_code_mask(
id_code: ExtendedId,
id_mask: ExtendedId,
rtr_code: bool,
rtr_mask: bool,
) -> Self
pub fn new_from_code_mask( id_code: ExtendedId, id_mask: ExtendedId, rtr_code: bool, rtr_mask: bool, ) -> Self
The masks indicate which bits of the code the filter should match against. Set bits in the mask indicate that the corresponding bit in the code should match.
Trait Implementations§
Source§impl Filter for SingleExtendedFilter
Available on crate feature unstable only.
impl Filter for SingleExtendedFilter
Available on crate feature
unstable only.Source§const FILTER_TYPE: FilterType = FilterType::Single
const FILTER_TYPE: FilterType = FilterType::Single
The type of the filter.
Source§fn to_registers(&self) -> [u8; 8]
fn to_registers(&self) -> [u8; 8]
Get the register level representation of the filter.
Source§fn filter_type(&self) -> FilterType
fn filter_type(&self) -> FilterType
Returns filter type.
Auto Trait Implementations§
impl Freeze for SingleExtendedFilter
impl RefUnwindSafe for SingleExtendedFilter
impl Send for SingleExtendedFilter
impl Sync for SingleExtendedFilter
impl Unpin for SingleExtendedFilter
impl UnwindSafe for SingleExtendedFilter
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