Allow to set the key context periodicity
This commit is contained in:
parent
9e3cfc2fd6
commit
e735198f6a
1 changed files with 4 additions and 0 deletions
|
@ -9,6 +9,10 @@ pub struct KeyContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl KeyContext {
|
impl KeyContext {
|
||||||
|
pub fn set_periodicity(&mut self, periodicity: u64) {
|
||||||
|
self.periodicity = Some(periodicity);
|
||||||
|
}
|
||||||
|
|
||||||
pub(crate) fn get_value(&self, time_period: Option<u64>) -> Vec<Vec<u8>> {
|
pub(crate) fn get_value(&self, time_period: Option<u64>) -> Vec<Vec<u8>> {
|
||||||
let mut ret: Vec<Vec<u8>> = self.ctx.iter().map(|s| s.as_bytes().to_vec()).collect();
|
let mut ret: Vec<Vec<u8>> = self.ctx.iter().map(|s| s.as_bytes().to_vec()).collect();
|
||||||
if let Some(tp) = time_period {
|
if let Some(tp) = time_period {
|
||||||
|
|
Loading…
Reference in a new issue