pub trait RecurrentStateHandle:
Send
+ Sync
+ Debug {
// Required methods
fn request_id(&self) -> RequestId;
fn device(&self) -> Device;
fn num_layers(&self) -> usize;
fn state_bytes(&self) -> usize;
fn clone_handle(&self) -> Result<Arc<dyn RecurrentStateHandle>>;
fn as_any(&self) -> &dyn Any;
fn stats(&self) -> RecurrentStateHandleStats;
fn is_valid(&self) -> bool;
fn cache_id(&self) -> String;
}Expand description
Recurrent-state cache handle.
Required Methods§
Sourcefn request_id(&self) -> RequestId
fn request_id(&self) -> RequestId
Request ID this state belongs to.
Sourcefn num_layers(&self) -> usize
fn num_layers(&self) -> usize
Number of model layers represented by this handle.
Sourcefn state_bytes(&self) -> usize
fn state_bytes(&self) -> usize
Approximate memory used by this state.
Sourcefn clone_handle(&self) -> Result<Arc<dyn RecurrentStateHandle>>
fn clone_handle(&self) -> Result<Arc<dyn RecurrentStateHandle>>
Clone handle reference. Implementations should not deep-copy state.
Sourcefn stats(&self) -> RecurrentStateHandleStats
fn stats(&self) -> RecurrentStateHandleStats
Handle statistics.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".