blob: 9737a9366d3d1fceb2aadda73bd085cc2f1eee9b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
use std::cell::RefCell;
use std::rc::Rc;
use async_trait::async_trait;
use deno_core::error::AnyError;
use deno_core::OpState;
use denokv_proto::Database;
#[async_trait(?Send)]
pub trait DatabaseHandler {
type DB: Database + 'static;
async fn open(
&self,
state: Rc<RefCell<OpState>>,
path: Option<String>,
) -> Result<Self::DB, AnyError>;
}
|