pub struct RedbStorage { /* private fields */ }Expand description
redb-backed persistent storage adapter for BEAM.
Stores the graph in a single redb database file. Each Put commits
inline (ACID) inside spawn_blocking so the fsync does not block the
async runtime. Reads are concurrent. Flush is an immediate ack (puts
already fsync on commit).
§Example
ⓘ
use beam::adapters::RedbStorage;
use beam::Config;
let storage = RedbStorage::new_with_config(Config::default(), "my-db.redb", None);Implementations§
Trait Implementations§
Source§impl Actor for RedbStorage
impl Actor for RedbStorage
Source§fn try_clone_storage(&self) -> Option<Box<dyn Actor>>
fn try_clone_storage(&self) -> Option<Box<dyn Actor>>
Returns a boxed clone for the storage read/write actor split.
Both the read and write actor share the same Arc<Database>, so
reads see committed writes immediately via redb’s MVCC snapshots.
Source§fn pre_start<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_ctx: &'life1 ActorContext,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn pre_start<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_ctx: &'life1 ActorContext,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Called once before the actor starts processing messages. Read more
Source§fn stopping<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_ctx: &'life1 ActorContext,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn stopping<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_ctx: &'life1 ActorContext,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Called once after the actor’s message loop exits. Read more
Source§fn handle<'life0, 'life1, 'async_trait>(
&'life0 mut self,
message: Message,
ctx: &'life1 ActorContext,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle<'life0, 'life1, 'async_trait>(
&'life0 mut self,
message: Message,
ctx: &'life1 ActorContext,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Handle an incoming message.
Source§fn subscribe_to_everything(&self) -> bool
fn subscribe_to_everything(&self) -> bool
Whether this actor wants to receive all messages (not just addressed
to it). Used by the Multicast adapter. Read more
Source§impl Clone for RedbStorage
impl Clone for RedbStorage
Auto Trait Implementations§
impl !RefUnwindSafe for RedbStorage
impl !UnwindSafe for RedbStorage
impl Freeze for RedbStorage
impl Send for RedbStorage
impl Sync for RedbStorage
impl Unpin for RedbStorage
impl UnsafeUnpin for RedbStorage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more