pub trait RankFuncCount: Default + EstimateSize {
// Required methods
fn count(&mut self, curr_key: StateKey) -> i64;
fn to_proto_state(&self) -> FunctionState;
fn from_proto_state(state: FunctionState) -> Result<Self>
where Self: Sized;
}Required Methods§
Sourcefn count(&mut self, curr_key: StateKey) -> i64
fn count(&mut self, curr_key: StateKey) -> i64
Count and return the rank for the given key, updating internal state.
Sourcefn to_proto_state(&self) -> FunctionState
fn to_proto_state(&self) -> FunctionState
Convert the function state to the proto oneof variant for persistence.
Sourcefn from_proto_state(state: FunctionState) -> Result<Self>where
Self: Sized,
fn from_proto_state(state: FunctionState) -> Result<Self>where
Self: Sized,
Restore the function state from the proto oneof variant. Returns an error if the variant does not match this function type.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.