draft bookmark toggle action

This commit is contained in:
yggverse 2024-11-14 09:30:40 +02:00
parent feca899c5b
commit 232f67b9cc
4 changed files with 49 additions and 5 deletions

View file

@ -9,6 +9,7 @@ pub struct Memory {
impl Memory {
// Constructors
/// Create new `Self`
pub fn new() -> Self {
Self {
index: RefCell::new(HashMap::new()),
@ -32,6 +33,7 @@ impl Memory {
index.insert(request, time);
}
/// Check request exist in memory index
pub fn is_exist(&self, request: &str) -> bool {
self.index.borrow().get(request).is_some()
}