vrc_get_litedb/engine/
mod.rs1#[macro_use]
2mod macros;
3
4mod buffer_reader;
5mod buffer_writer;
6mod collection_index;
7mod collection_service;
8mod constants;
9mod data_block;
10mod data_service;
11mod disk;
12mod engine_pragmas;
13mod index_node;
14mod index_service;
15mod lite_engine;
16mod lock_service;
17mod page_address;
18mod page_buffer;
19mod page_position;
20mod pages;
21mod snapshot;
22mod transaction_monitor;
23mod transaction_pages;
24mod transaction_service;
25pub(crate) mod utils;
26mod wal_index_service;
27
28pub(crate) use super::Result;
29pub(crate) use buffer_reader::*;
30pub(crate) use buffer_writer::*;
31pub(crate) use constants::*;
32use futures::{AsyncRead, AsyncSeek, AsyncWrite};
33pub(crate) use index_node::*;
34pub(crate) use page_address::*;
35pub(crate) use page_buffer::*;
36pub(crate) use pages::*;
37use std::pin::Pin;
38pub(crate) type PageBufferArray = [u8; PAGE_SIZE];
39
40pub use lite_engine::*;
42
43pub trait FileStream: AsyncRead + AsyncWrite + AsyncSeek + Unpin + Send + Sync {
44 fn set_len(&self, len: u64) -> Pin<Box<dyn Future<Output = Result<()>> + Send + Sync + '_>>;
46}
47
48#[allow(clippy::len_without_is_empty)]
49pub trait StreamFactory: Send + Sync {
50 #[allow(clippy::type_complexity)]
51 fn get_stream(
52 &self,
53 writable: bool,
54 ) -> Pin<Box<dyn Future<Output = Result<Box<dyn FileStream>>> + Send + Sync + '_>>;
55 fn exists(&self) -> Pin<Box<dyn Future<Output = bool> + Send + Sync + '_>>;
56 fn len(&self) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + Sync + '_>>;
57 fn delete(&self) -> Pin<Box<dyn Future<Output = Result<()>> + Send + Sync + '_>>;
58}