pub struct TokenBlockMmInfo {
pub mm_hash: u64,
pub offset: usize,
pub length: usize,
}Expand description
Metadata describing a single multimodal placeholder run within a token sequence.
A run occupies length consecutive slots starting at offset. The token IDs at
those slot positions are opaque for hashing — the (mm_hash, run_offset) pair drives
the per-slot bytes during block formation.
See compute_block_bytes_with_mm for the byte-encoding rule.
Fields§
§mm_hash: u64Hash identifying the multimodal object (image / audio / etc.).
offset: usizeStart position of the placeholder run in the full token sequence (zero-based).
length: usizeNumber of placeholder slots in the run.
Implementations§
Source§impl TokenBlockMmInfo
impl TokenBlockMmInfo
Sourcepub fn checked_end(&self) -> Option<usize>
pub fn checked_end(&self) -> Option<usize>
Returns the exclusive end position of this run, or None on usize overflow.
Sourcepub fn end(&self) -> usize
pub fn end(&self) -> usize
Returns the exclusive end position of this run.
§Panics
Panics if offset + length overflows usize. Prefer Self::checked_end in
validation paths; this helper is for already-validated runs.
Sourcepub fn covers(&self, position: usize) -> bool
pub fn covers(&self, position: usize) -> bool
Returns true if the given absolute position falls inside this run.
Returns false if the run’s end overflows usize (such a run is invalid; use
validate_and_sort_mm_info before relying on this method).
Trait Implementations§
Source§impl Clone for TokenBlockMmInfo
impl Clone for TokenBlockMmInfo
Source§fn clone(&self) -> TokenBlockMmInfo
fn clone(&self) -> TokenBlockMmInfo
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for TokenBlockMmInfo
Source§impl Debug for TokenBlockMmInfo
impl Debug for TokenBlockMmInfo
Source§impl<'de> Deserialize<'de> for TokenBlockMmInfo
impl<'de> Deserialize<'de> for TokenBlockMmInfo
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TokenBlockMmInfo, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TokenBlockMmInfo, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for TokenBlockMmInfo
Source§impl From<RequestMmObjectInfo> for TokenBlockMmInfo
impl From<RequestMmObjectInfo> for TokenBlockMmInfo
Source§fn from(v: RequestMmObjectInfo) -> Self
fn from(v: RequestMmObjectInfo) -> Self
Source§impl From<TokenBlockMmInfo> for RequestMmObjectInfo
impl From<TokenBlockMmInfo> for RequestMmObjectInfo
Source§fn from(v: TokenBlockMmInfo) -> Self
fn from(v: TokenBlockMmInfo) -> Self
Source§impl Hash for TokenBlockMmInfo
impl Hash for TokenBlockMmInfo
Source§impl PartialEq for TokenBlockMmInfo
impl PartialEq for TokenBlockMmInfo
Source§fn eq(&self, other: &TokenBlockMmInfo) -> bool
fn eq(&self, other: &TokenBlockMmInfo) -> bool
self and other values to be equal, and is used by ==.