mirror of
https://github.com/denoland/deno.git
synced 2025-01-19 12:16:17 -05:00
ea30e188a8
Closes #26171 --------- Co-authored-by: David Sherret <dsherret@gmail.com>
20 lines
416 B
Rust
20 lines
416 B
Rust
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
|
|
use std::cell::RefCell;
|
|
use std::rc::Rc;
|
|
|
|
use async_trait::async_trait;
|
|
use deno_core::OpState;
|
|
use deno_error::JsErrorBox;
|
|
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, JsErrorBox>;
|
|
}
|