pub struct BitPtrMut { /* private fields */ }Expand description
A mutable pointer to a bit in memory.
Analagous to *mut T.
Implementations§
Source§impl BitPtrMut
impl BitPtrMut
Sourcepub const fn new(byte: *mut u8, subbyte_bit: SubByte) -> Self
pub const fn new(byte: *mut 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: *mut u8) -> Self
pub const fn new_on_byte(byte: *mut 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: *mut u8, bit_count: isize) -> Self
pub const unsafe fn new_with_offset(byte: *mut u8, bit_count: isize) -> Self
Create a new raw bit pointer from a raw byte pointer and a bit offset.
§Safety
new_with_offset has the same safety concerns as (*const _)::offset.
Source§impl BitPtrMut
impl BitPtrMut
Sourcepub const fn floor_byte(&self) -> *mut u8
pub const fn floor_byte(&self) -> *mut 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 BitPtrMut
impl BitPtrMut
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.