Resource

Trait Resource 

Source
pub trait Resource: Send + Sync {
    // Required methods
    fn size_bytes(&self) -> usize;
    fn resource_type(&self) -> &str;
}
Expand description

A resource that can be shared across multiple node instances.

Resources are typically expensive to create (ML models, GPU contexts, etc.) and benefit from sharing across multiple pipeline instances.

Required Methods§

Source

fn size_bytes(&self) -> usize

Returns the approximate memory footprint in bytes. Used for LRU eviction when memory limits are configured.

Source

fn resource_type(&self) -> &str

Returns a human-readable type identifier (e.g., “ml_model”, “gpu_context”). Used for observability and debugging.

Implementors§