Skip to main content

FilterConfig

Trait FilterConfig 

Source
pub trait FilterConfig {
    type Error;
    type FiltersHandle<'a>: 'a
       where Self: 'a;

    // Required methods
    fn set_filters(
        &mut self,
        filters: &[IdMaskFilter],
    ) -> Result<(), Self::Error>
       where Self: Sized;
    fn modify_filters(&mut self) -> Self::FiltersHandle<'_>;
}
Expand description

Configure acceptance filters (aka “hardware filtering”).

CAN controllers often provide a fixed number of acceptance filter “banks”. Protocol layers may want to install filters to reduce host-side work.

Required Associated Types§

Source

type Error

Error returned by the driver implementation.

Source

type FiltersHandle<'a>: 'a where Self: 'a

Handle used for modifying filters in-place (e.g. a bank accessor).

Some drivers expose more complex configuration operations than “set this list”. A borrowed handle enables in-place modifications without forcing a particular API shape.

Required Methods§

Source

fn set_filters(&mut self, filters: &[IdMaskFilter]) -> Result<(), Self::Error>
where Self: Sized,

Replace the current filter configuration with a list of ID/mask pairs.

Implementations may error if:

  • the number of filters exceeds hardware limits, or
  • a filter is not representable in hardware (e.g. mask width mismatch).
Source

fn modify_filters(&mut self) -> Self::FiltersHandle<'_>

Access filter banks through a handle (optional ergonomic API).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§