mirror of
https://github.com/denoland/deno
synced 2024-11-05 18:45:24 +00:00
20 lines
439 B
Rust
20 lines
439 B
Rust
// 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>;
|
|
}
|