[−][src]Struct gf::support::buffer::BufferPage
A fixed-size buffer page.
Fields
data: [u8; 4096]
Page data.
mask: [u8; 4096]
Page mask.
Implementations
impl BufferPage
[src]
pub const SIZE_BITS: usize
[src]
Page size in bits.
pub const SIZE_BITS_LOG2: usize
[src]
Page size in bits as power of two.
pub const SIZE_BYTES: usize
[src]
Page size in bytes.
pub const SIZE_BYTES_LOG2: usize
[src]
Page size in bytes as power of two.
pub fn new() -> Self
[src]
Construct an entirely undefined page.
pub fn get_bit(&self, bit_index: usize) -> Option<bool>
[src]
pub fn get_byte(&self, byte_index: usize) -> Option<u8>
[src]
Return byte value at byte_index
, None
if byte has undefined bits.
Errors
- Panics on out-of-bound indexing.
pub fn get_bytes(&self, byte_index: usize, num_bytes: usize) -> Option<&[u8]>
[src]
Return values of num_bytes
bytes starting at byte_index
, None
if
any of the bytes is undefined.
Errors
- Panics on out-of-bound indexing.
pub fn set_bit(&mut self, bit_index: usize, value: bool)
[src]
pub fn set_byte(&mut self, byte_index: usize, value: u8)
[src]
pub fn set_bytes(&mut self, byte_index: usize, slice: &[u8])
[src]
pub fn unset_bit(&mut self, bit_index: usize)
[src]
pub fn unset_byte(&mut self, byte_index: usize)
[src]
pub fn unset_bytes(&mut self, byte_index: usize, byte_count: usize)
[src]
Trait Implementations
impl Clone for BufferPage
[src]
fn clone(&self) -> BufferPage
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Default for BufferPage
[src]
Auto Trait Implementations
impl RefUnwindSafe for BufferPage
impl Send for BufferPage
impl Sync for BufferPage
impl Unpin for BufferPage
impl UnwindSafe for BufferPage
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,