Files
servo/components/storage/webstorage/engines/mod.rs
Ashwin Naren 025abc855e storage: Simplify layout of storage crate (#40124)
Due to old design choices, we had the layout of:
```
| - storage
|    - indexeddb
|        - mod.rs
|        - idb_thread.rs
|        - engines/
|    - webstorage
|        - mod.rs
|        - webstorage_thread.rs
|        - engines/
```

I merged the `*_thread` file into `mod.rs`, since `mod.rs` is pretty
empty. This should be a better layout for when more threads are
introduced.

Testing: Refactor, none needed

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
2025-10-24 07:19:08 +00:00

17 lines
598 B
Rust

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::webstorage::OriginEntry;
pub mod sqlite;
pub trait WebStorageEngine {
type Error;
fn load(&self) -> Result<OriginEntry, Self::Error>;
fn clear(&mut self) -> Result<(), Self::Error>;
fn delete(&mut self, key: &str) -> Result<(), Self::Error>;
fn set(&mut self, key: &str, value: &str) -> Result<(), Self::Error>;
fn save(&mut self, data: &OriginEntry);
}