Skip to main content

Bits

Struct Bits 

Source
pub struct Bits { /* private fields */ }
Expand description

A bundle’s peek bits (2.6 step 4’s peek table): its top-level row count and a bit per row in directory order, set for a bundle, packed eight to a byte, in a buffer charged to its meter before it is allocated.

Implementations§

Source§

impl Bits

Source

pub fn charged(rows: u32, meter: &Arc<Meter>) -> Result<Self, Class>

The bits of rows rows, all clear, charged to meter first: the buffer a peek fills, or an attempt reads a peek file into.

Source

pub fn copied( bits: &Self, meter: &Arc<Meter>, hooks: &dyn Hooks, ) -> Result<Self, Failure>

A copy of bits (as a peek file holds them) in a buffer charged to meter first, the charge under the refusal probe of hooks: what a PeekBits loader gives (review round 4’s T2), so a refusal no budget counted is the stop host_memory there too.

Source

pub fn rows(&self) -> u32

The row count.

Source

pub fn bytes(&self) -> &[u8] ⓘ

The packed bits, ceil(rows / 8) bytes: a peek file’s bytes.

Source

pub fn bytes_mut(&mut self) -> &mut [u8] ⓘ

The packed bits to fill (a peek file’s bytes, read into them).

Source

pub fn get(&self, i: usize) -> bool

Row i’s bit.

Source

pub fn set(&mut self, i: usize)

Sets row i’s bit.

Trait Implementations§

Source§

impl Debug for Bits

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Bits

§

impl !UnwindSafe for Bits

§

impl Forget for Bits

§

impl Freeze for Bits

§

impl Move for Bits

§

impl Send for Bits

§

impl Sync for Bits

§

impl Unpin for Bits

§

impl UnsafeUnpin for Bits

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.