pub struct BitPtr { /* private fields */ }Expand description
Analagous to *const T.
Implementations§
Source§impl BitPtr
impl BitPtr
Sourcepub const fn new(byte: *const u8, subbyte_bit: SubByte) -> Self
pub const fn new(byte: *const u8, subbyte_bit: SubByte) -> Self
Create a new raw bit pointer from a raw byte pointer and a sub-byte bit offset.
Sourcepub const fn new_on_byte(byte: *const u8) -> Self
pub const fn new_on_byte(byte: *const u8) -> Self
Create a new raw bit pointer from a raw byte pointer and zero bit offset.
Sourcepub const unsafe fn new_with_offset(byte: *const u8, bit_count: isize) -> Self
pub const unsafe fn new_with_offset(byte: *const u8, bit_count: isize) -> Self
Create a new raw bit pointer from a raw byte pointer and a bit offset.
Source§impl BitPtr
impl BitPtr
Sourcepub const fn floor_byte(&self) -> *const u8
pub const fn floor_byte(&self) -> *const u8
Returns the raw byte pointer, rounded down.
Sourcepub const fn subbyte_bit(&self) -> SubByte
pub const fn subbyte_bit(&self) -> SubByte
Returns the sub-byte bit offset of this raw bit pointer.
Source§impl BitPtr
impl BitPtr
Sourcepub const unsafe fn byte_offset(self, count: isize) -> Self
pub const unsafe fn byte_offset(self, count: isize) -> Self
Adds a signed offset in bytes to a bit pointer.
count is in a unit of bytes.
Analagous to (*const _)::byte_offset.
Sourcepub const unsafe fn bit_offset(self, count: isize) -> Self
pub const unsafe fn bit_offset(self, count: isize) -> Self
Adds a signed offset in bits to a bit pointer.
count is in a unit of bits.
Analagous to (*const _)::byte_offset.
Sourcepub const fn wrapping_byte_offset(self, count: isize) -> Self
pub const fn wrapping_byte_offset(self, count: isize) -> Self
Adds a signed offset in bytes to a bit pointer using wrapping arithmetic.
count is in a unit of bytes.
Analagous to (*const _)::wrapping_byte_offset.
Trait Implementations§
Source§impl Ord for BitPtr
impl Ord for BitPtr
Source§impl PartialOrd for BitPtr
impl PartialOrd for BitPtr
impl Copy for BitPtr
impl Eq for BitPtr
impl StructuralPartialEq for BitPtr
Auto Trait Implementations§
impl Freeze for BitPtr
impl RefUnwindSafe for BitPtr
impl !Send for BitPtr
impl !Sync for BitPtr
impl Unpin for BitPtr
impl UnwindSafe for BitPtr
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