pub struct PhysicalBlock {
pub id: usize,
pub block_size: usize,
pub ref_count: usize,
pub num_tokens: usize,
pub prefix_hash: Option<u64>,
pub tokens: Vec<u32>,
}Expand description
Represents a physical memory block storing KV-tensors for a fixed number of tokens.
Fields§
§id: usize§block_size: usize§ref_count: usizeReference count for Copy-on-Write and prefix sharing.
num_tokens: usizeNumber of valid tokens currently stored in this block.
prefix_hash: Option<u64>Cached hash of the token sequence prefix stored in this block (for prefix caching).
tokens: Vec<u32>Token IDs stored in this block (for tracking and prefix matching).
Implementations§
Trait Implementations§
Source§impl Clone for PhysicalBlock
impl Clone for PhysicalBlock
Source§fn clone(&self) -> PhysicalBlock
fn clone(&self) -> PhysicalBlock
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Forget for PhysicalBlock
impl Freeze for PhysicalBlock
impl Move for PhysicalBlock
impl RefUnwindSafe for PhysicalBlock
impl Send for PhysicalBlock
impl Sync for PhysicalBlock
impl Unpin for PhysicalBlock
impl UnsafeUnpin for PhysicalBlock
impl UnwindSafe for PhysicalBlock
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more