pub struct CacheEntry {
pub seq: Seq,
pub tokens: Vec<u32>,
pub pins: u32,
pub last_used: u64,
pub bytes: u64,
pub seeded: u32,
pub shared: bool,
pub exported: Option<Vec<u8>>,
pub prompt: u64,
}Fields§
§seq: SeqThe entry’s sequence while it is in the pool, and its name either way (a runtime never hands a handle out twice).
tokens: Vec<u32>§pins: u32§last_used: u64§bytes: u64§seeded: u32Lanes started from this entry.
A copy of a live lane’s state, published for the requests that share its prefix: a lane seeded from it copies, never takes it over.
exported: Option<Vec<u8>>Some: the entry is out of the pool, held as the runtime’s lossless
export of its tokens.len() tokens of state; its sequence is freed.
prompt: u64How much of tokens was the prompt of the lane that left the entry
(the rest it generated); 0 where none is known.
Implementations§
Source§impl CacheEntry
impl CacheEntry
Whether len tokens are a real part of this entry.
Sourcepub fn serves(&self, len: u64) -> bool
pub fn serves(&self, len: u64) -> bool
Whether a seed of len tokens is served from this entry: any, from
one in the pool (a copy); a real part of it, from an export.
An entry holds a prefix requests share when it is a lane’s state published for them, or has started two lanes or more: it goes after every entry that does not.
Sourcepub fn covered_by(&self, other: &CacheEntry) -> bool
pub fn covered_by(&self, other: &CacheEntry) -> bool
Whether other serves what this entry does: its tokens begin with all of this
entry’s, or all but a share of them when it was used later.
Auto Trait Implementations§
impl Freeze for CacheEntry
impl RefUnwindSafe for CacheEntry
impl Send for CacheEntry
impl Sync for CacheEntry
impl Unpin for CacheEntry
impl UnsafeUnpin for CacheEntry
impl UnwindSafe for CacheEntry
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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> ⓘ
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