pub struct KvPageGeometryV1 {
pub schema_version: String,
pub tokens_per_page: u32,
pub vectors_per_block: u32,
pub head_dim: u32,
pub encoded_block_bytes: u32,
pub raw_vector_bytes: u32,
}Expand description
Fixed-size page geometry.
Fields§
§schema_version: StringStable schema marker.
tokens_per_page: u32Number of tokens per encoded page.
vectors_per_block: u32Number of logical vectors per encoded block.
head_dim: u32Number of channels in each logical vector.
encoded_block_bytes: u32Fixed encoded bytes reserved for each block.
raw_vector_bytes: u32Fixed raw f32 bytes per logical vector.
Implementations§
Source§impl KvPageGeometryV1
impl KvPageGeometryV1
Sourcepub fn new(
tokens_per_page: u32,
head_dim: u32,
encoded_block_bytes: u32,
) -> Self
pub fn new( tokens_per_page: u32, head_dim: u32, encoded_block_bytes: u32, ) -> Self
Build a page geometry for one-vector blocks.
Sourcepub fn validate_for_shape(&self, shape: &KvTensorShapeV1) -> Result<()>
pub fn validate_for_shape(&self, shape: &KvTensorShapeV1) -> Result<()>
Validate page geometry for a shape.
Sourcepub fn page_count(&self, shape: &KvTensorShapeV1) -> Result<u32>
pub fn page_count(&self, shape: &KvTensorShapeV1) -> Result<u32>
Number of token pages in a shape.
Sourcepub fn digest(&self, shape: &KvTensorShapeV1) -> Result<String>
pub fn digest(&self, shape: &KvTensorShapeV1) -> Result<String>
Stable digest.
Trait Implementations§
Source§impl Clone for KvPageGeometryV1
impl Clone for KvPageGeometryV1
Source§fn clone(&self) -> KvPageGeometryV1
fn clone(&self) -> KvPageGeometryV1
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 moreSource§impl Debug for KvPageGeometryV1
impl Debug for KvPageGeometryV1
Source§impl<'de> Deserialize<'de> for KvPageGeometryV1
impl<'de> Deserialize<'de> for KvPageGeometryV1
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
Source§impl PartialEq for KvPageGeometryV1
impl PartialEq for KvPageGeometryV1
Source§fn eq(&self, other: &KvPageGeometryV1) -> bool
fn eq(&self, other: &KvPageGeometryV1) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for KvPageGeometryV1
impl Serialize for KvPageGeometryV1
impl Eq for KvPageGeometryV1
impl StructuralPartialEq for KvPageGeometryV1
Auto Trait Implementations§
impl Freeze for KvPageGeometryV1
impl RefUnwindSafe for KvPageGeometryV1
impl Send for KvPageGeometryV1
impl Sync for KvPageGeometryV1
impl Unpin for KvPageGeometryV1
impl UnsafeUnpin for KvPageGeometryV1
impl UnwindSafe for KvPageGeometryV1
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.