pub struct SubByte { /* private fields */ }Expand description
A sub-byte offset.
Implementations§
Source§impl SubByte
impl SubByte
Sourcepub const fn new(bit: u8) -> Option<Self>
pub const fn new(bit: u8) -> Option<Self>
Create a new SubByte from a sub-byte offset.
§Returns
Returns None if bit is 8 or greater, as it is not valid.
Sourcepub const unsafe fn new_unchecked(bit: u8) -> Self
pub const unsafe fn new_unchecked(bit: u8) -> Self
Create a new SubByte from a sub-byte offset, without checking if it is valid.
§Safety
Behaviour is undefined if bit is not less than 8.
Trait Implementations§
Source§impl Ord for SubByte
impl Ord for SubByte
Source§impl PartialOrd for SubByte
impl PartialOrd for SubByte
impl Copy for SubByte
impl Eq for SubByte
impl StructuralPartialEq for SubByte
Auto Trait Implementations§
impl Freeze for SubByte
impl RefUnwindSafe for SubByte
impl Send for SubByte
impl Sync for SubByte
impl Unpin for SubByte
impl UnwindSafe for SubByte
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