pub struct Mask16 { /* private fields */ }
Expand description
A 16-bit identifier mask.
Implementations§
Source§impl Mask16
impl Mask16
Sourcepub fn accept_all() -> Self
pub fn accept_all() -> Self
Creates a 16-bit identifier mask that accepts all frames.
This will accept both standard and extended data and remote frames with any ID.
Sourcepub fn frames_with_std_id(id: StandardId, mask: StandardId) -> Self
pub fn frames_with_std_id(id: StandardId, mask: StandardId) -> Self
Creates a 16-bit identifier mask that accepts all frames with the given standard ID and mask combination.
Filter logic: frame_accepted = (incoming_id & mask) == (id & mask)
A mask of all all ones (0x7FF
) matches an exact ID, a mask of 0 matches all IDs.
Both data and remote frames with id
will be accepted. Any extended frames will be
rejected.
Sourcepub fn data_frames_only(&mut self) -> &mut Self
pub fn data_frames_only(&mut self) -> &mut Self
Make the filter accept data frames only.
Sourcepub fn remote_frames_only(&mut self) -> &mut Self
pub fn remote_frames_only(&mut self) -> &mut Self
Make the filter accept remote frames only.
Trait Implementations§
impl Copy for Mask16
Auto Trait Implementations§
impl Freeze for Mask16
impl RefUnwindSafe for Mask16
impl Send for Mask16
impl Sync for Mask16
impl Unpin for Mask16
impl UnwindSafe for Mask16
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