pub struct SharedDb { /* private fields */ }Expand description
Shared handle to an on-disk GraphDb. Clone is cheap and shares state.
§Event-sink deadlock
GraphDb::set_event_sink runs the hook inside log_then_apply while
this write guard is still held. A sink must never call SharedDb::read
or SharedDb::write on the same handle (the RwLock is not
re-entrant). The sink is Send + Sync; std::sync::mpsc::Sender
is not Sync. Intended examples: std::sync::mpsc::SyncSender,
tokio::sync::mpsc::Sender, tokio::sync::broadcast::Sender, or
Arc<Mutex<Vec<_>>>.
Implementations§
Trait Implementations§
Auto Trait Implementations§
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