pub struct BlockTable { /* private fields */ }Expand description
Per-sequence mapping from logical to physical blocks.
Implementations§
Source§impl BlockTable
impl BlockTable
Sourcepub fn num_blocks(&self) -> usize
pub fn num_blocks(&self) -> usize
Number of allocated blocks.
Sourcepub fn num_tokens(&self) -> usize
pub fn num_tokens(&self) -> usize
Number of tokens stored.
Sourcepub fn logical_to_physical(&self, logical_idx: usize) -> Option<BlockId>
pub fn logical_to_physical(&self, logical_idx: usize) -> Option<BlockId>
Map logical block index to physical block ID.
Sourcepub fn append_block(&mut self, block_id: BlockId)
pub fn append_block(&mut self, block_id: BlockId)
Add a new block mapping.
Sourcepub fn token_to_block(&self, token_pos: usize) -> (usize, usize)
pub fn token_to_block(&self, token_pos: usize) -> (usize, usize)
Convert token position to (logical_block_idx, offset_within_block).
Sourcepub fn set_num_tokens(&mut self, n: usize)
pub fn set_num_tokens(&mut self, n: usize)
Update the token count.
Source§impl BlockTable
impl BlockTable
Auto Trait Implementations§
impl Freeze for BlockTable
impl RefUnwindSafe for BlockTable
impl Send for BlockTable
impl Sync for BlockTable
impl Unpin for BlockTable
impl UnsafeUnpin for BlockTable
impl UnwindSafe for BlockTable
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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more