Skip to main content

NodeDbMarker

Trait NodeDbMarker 

Source
pub trait NodeDbMarker: Send + Sync { }
Expand description

Marker bound for NodeDb and the futures it returns.

On native targets the bound is Send + Sync — matching the multi-thread Tokio runtime that backs both Origin and the desktop / mobile-FFI Lite callers. On wasm32 the bound is empty: JS is single-threaded, so requiring Send on futures returned by the trait would force every !Send engine internal (redb transactions, Rc<...>, etc.) to be rewritten for no benefit.

The #[async_trait] attribute on the trait + each impl is correspondingly cfg-swapped between the default (Send futures) and ?Send (no Send bound) variants.

Implementors§

Source§

impl<T: Send + Sync + ?Sized> NodeDbMarker for T

Available on non-WebAssembly only.