[][src]Struct gf::support::buffer::BufferPage

#[repr(C)]
pub struct BufferPage {
    pub data: [u8; 4096],
    pub mask: [u8; 4096],
}

A fixed-size buffer page.

Fields

data: [u8; 4096]

Page data.

mask: [u8; 4096]

Page mask.

Methods

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]

Return bit value at bit_index, None if undefined.

Errors

  • Panics on out-of-bound indexing.

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]

Set bit value at bit_index to value.

Errors

  • Panics on out-of-bound indexing.

pub fn set_byte(&mut self, byte_index: usize, value: u8)[src]

Set byte value at byte_index to value.

Errors

  • Panics on out-of-bound indexing.

pub fn set_bytes(&mut self, byte_index: usize, slice: &[u8])[src]

Set bytes starting at byte_index from a slice.

Errors

  • Panics on out-of-bound indexing.

pub fn unset_bit(&mut self, bit_index: usize)[src]

Unset bit at bit_index.

Errors

  • Panics on out-of-bound indexing.

pub fn unset_byte(&mut self, byte_index: usize)[src]

Unset byte at byte_index.

Errors

  • Panics on out-of-bound indexing.

pub fn unset_bytes(&mut self, byte_index: usize, byte_count: usize)[src]

Unset byte_count bytes starting at byte_index.

Errors

  • Panics on out-of-bound indexing.

Trait Implementations

impl Clone for BufferPage[src]

impl Default for BufferPage[src]

Auto Trait Implementations

impl Send for BufferPage

impl Sync for BufferPage

impl Unpin for BufferPage

impl UnwindSafe for BufferPage

impl RefUnwindSafe for BufferPage

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]