pub struct FunctionState {
pub version: u32,
pub function_name: String,
pub created_at: u64,
pub modified_at: u64,
pub model_state: ModelState,
pub cache_state: CacheState,
pub execution_state: ExecutionState,
pub metadata: HashMap<String, String>,
}Expand description
Function state for hibernation/resume
Fields§
§version: u32State version
function_name: StringFunction name
created_at: u64Created timestamp (unix ms)
modified_at: u64Last modified timestamp (unix ms)
model_state: ModelStateModel state
cache_state: CacheStateCache state
execution_state: ExecutionStateExecution state
metadata: HashMap<String, String>Custom metadata
Implementations§
Source§impl FunctionState
impl FunctionState
Sourcepub fn get_metadata(&self, key: &str) -> Option<&String>
pub fn get_metadata(&self, key: &str) -> Option<&String>
Get metadata
Sourcepub fn record_success(&mut self, latency_ms: f64)
pub fn record_success(&mut self, latency_ms: f64)
Record successful request
Sourcepub fn record_failure(&mut self)
pub fn record_failure(&mut self)
Record failed request
Sourcepub fn success_rate(&self) -> f64
pub fn success_rate(&self) -> f64
Success rate
Trait Implementations§
Source§impl Clone for FunctionState
impl Clone for FunctionState
Source§fn clone(&self) -> FunctionState
fn clone(&self) -> FunctionState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FunctionState
impl Debug for FunctionState
Source§impl<'de> Deserialize<'de> for FunctionState
impl<'de> Deserialize<'de> for FunctionState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for FunctionState
impl RefUnwindSafe for FunctionState
impl Send for FunctionState
impl Sync for FunctionState
impl Unpin for FunctionState
impl UnwindSafe for FunctionState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more