pub struct TokenBatchState {
pub version: u32,
pub sampler: SamplerState,
pub lengths: Vec<usize>,
pub options: TokenBatchOptions,
}Available on crate feature
std only.Expand description
Complete batch continuation, including the actual immutable length table.
Fields§
§version: u32Record format, currently one.
sampler: SamplerStateCommitted sample order and explicit immutable source identity.
lengths: Vec<usize>One caller-supplied encoded length per original source example.
options: TokenBatchOptionsExact token accounting/limits used to partition that order.
Implementations§
Source§impl TokenBatchState
impl TokenBatchState
Sourcepub fn validate(&self) -> Result<(), SamplerError>
pub fn validate(&self) -> Result<(), SamplerError>
Check source geometry and all length/limit metadata before restoration.
Trait Implementations§
Source§impl Clone for TokenBatchState
impl Clone for TokenBatchState
Source§impl Debug for TokenBatchState
impl Debug for TokenBatchState
Source§impl<'de> Deserialize<'de> for TokenBatchState
impl<'de> Deserialize<'de> for TokenBatchState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for TokenBatchState
Source§impl PartialEq for TokenBatchState
impl PartialEq for TokenBatchState
Source§impl<B: Backend> Record<B> for TokenBatchState
impl<B: Backend> Record<B> for TokenBatchState
Source§type Item<P: PrecisionSettings> = TokenBatchState
type Item<P: PrecisionSettings> = TokenBatchState
Type of the item that can be serialized and deserialized.
Source§fn into_item<P: PrecisionSettings>(self) -> Self
fn into_item<P: PrecisionSettings>(self) -> Self
Convert the current record into the corresponding item that follows the given settings.
Source§fn from_item<P: PrecisionSettings>(item: Self, _: &B::Device) -> Self
fn from_item<P: PrecisionSettings>(item: Self, _: &B::Device) -> Self
Convert the given item into a record.
Source§impl Serialize for TokenBatchState
impl Serialize for TokenBatchState
impl StructuralPartialEq for TokenBatchState
Auto Trait Implementations§
impl Freeze for TokenBatchState
impl RefUnwindSafe for TokenBatchState
impl Send for TokenBatchState
impl Sync for TokenBatchState
impl Unpin for TokenBatchState
impl UnsafeUnpin for TokenBatchState
impl UnwindSafe for TokenBatchState
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.