SingleExtendedFilter

Struct SingleExtendedFilter 

Source
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

Source

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");
Source

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.
Source§

const FILTER_TYPE: FilterType = FilterType::Single

The type of the filter.
Source§

fn to_registers(&self) -> [u8; 8]

Get the register level representation of the filter.
Source§

fn filter_type(&self) -> FilterType

Returns filter type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.