Skip to main content

WeightComponentSource

Trait WeightComponentSource 

Source
pub trait WeightComponentSource: Send + Sync {
    // Required method
    fn component<'source>(
        &'source self,
        component: &WeightComponentSpec,
    ) -> Result<WeightComponentPayload<'source>, VNextError>;

    // Provided method
    fn component_segments<'source>(
        &'source self,
        component: &WeightComponentSpec,
    ) -> Result<WeightComponentSegments<'source>, VNextError> { ... }
}
Expand description

Backend-neutral source of schema-addressed physical weight components. Implementations own checkpoint file-format discovery and source-payload validation. The execution plan’s trusted super::WeightMaterializer owns any repacking or quantization before resource initialization performs placement and device submission.

Required Methods§

Source

fn component<'source>( &'source self, component: &WeightComponentSpec, ) -> Result<WeightComponentPayload<'source>, VNextError>

Provided Methods§

Source

fn component_segments<'source>( &'source self, component: &WeightComponentSpec, ) -> Result<WeightComponentSegments<'source>, VNextError>

Return deterministic source-order segments for one component.

Existing sources remain compatible through a one-segment wrapper. Format adapters may override this method to expose independently retained mmap ranges without changing the contiguous component() contract used by existing materializers and upload paths.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§