mirror of
https://github.com/servo/servo
synced 2026-04-26 01:25:32 +02:00
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>
17 lines
598 B
Rust
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);
|
|
}
|