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 more