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§
Sourcefn size_bytes(&self) -> usize
fn size_bytes(&self) -> usize
Returns the approximate memory footprint in bytes. Used for LRU eviction when memory limits are configured.
Sourcefn resource_type(&self) -> &str
fn resource_type(&self) -> &str
Returns a human-readable type identifier (e.g., “ml_model”, “gpu_context”). Used for observability and debugging.