pub struct Mask32 { /* private fields */ }
Expand description
A 32-bit identifier mask.
Implementations§
Source§impl Mask32
impl Mask32
Sourcepub fn accept_all() -> Self
pub fn accept_all() -> Self
Creates a 32-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_ext_id(id: ExtendedId, mask: ExtendedId) -> Self
pub fn frames_with_ext_id(id: ExtendedId, mask: ExtendedId) -> Self
Creates a 32-bit identifier mask that accepts all frames with the given extended ID and mask combination.
Filter logic: frame_accepted = (incoming_id & mask) == (id & mask)
A mask of all all ones (0x1FFF_FFFF
) matches an exact ID, a mask of 0 matches all IDs.
Both data and remote frames with id
will be accepted. Standard frames will be rejected.
Sourcepub fn frames_with_std_id(id: StandardId, mask: StandardId) -> Self
pub fn frames_with_std_id(id: StandardId, mask: StandardId) -> Self
Creates a 32-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 the exact ID, a mask of 0 matches all IDs.
Both data and remote frames with id
will be accepted. 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.