Struct hubs::Chunk[][src]

pub struct Chunk<T> {
    pub capacity: usize,
    pub used: usize,
    pub data: Box<[T]>,
}
Expand description

A Chunk of Data.

A Chunk contains an array of your desired datatype T. The variable used has to be set to the amount of valid values in data. There must be no gaps in data but it does not has to be fully used. A chunk bust be comitted to be readable, see HubsWriteAccess.

If you did not manually clear the chunk content, there will be stale data in the chunk from the previous round. This is ok, if you set the used variable correcly.

Fields

capacity: usize

The capacity of this chunk, do not change

used: usize

Count of used elements in this chunk. Set this before you commit

data: Box<[T]>

The data in this chunk. Feel free to borrow the data to other functions, e.g. a network receive

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.