pub struct BufferCache {
    priority: usize,
    block_id: usize,
    buffer: &'static mut [u8; 512],
}

Fields

priority: usize

Every time kernel tried to alloc this buffer this number will increase 1(at most 3) When no free cache lefted this number will decrease 1(at least 0) When it’s 0 and Arc’s strong count is 1, this buffer will be writed back

block_id: usize

If block_id is usize::Max, we assume it is an unused buffer.

buffer: &'static mut [u8; 512]

Implementations

Trait Implementations

The read-only mapper to the block cache

The mutable mapper to the block cache

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.