pub trait GraphWriter {
// Required methods
fn put_node(&self, node: &Node) -> Result<()>;
fn put_edge(&self, edge: &Edge) -> Result<()>;
fn delete_edge(&self, id: EdgeId) -> Result<()>;
fn detach_delete_node(&self, id: NodeId) -> Result<()>;
// Provided methods
fn create_property_index(&self, _label: &str, _property: &str) -> Result<()> { ... }
fn drop_property_index(&self, _label: &str, _property: &str) -> Result<()> { ... }
fn list_property_indexes(&self) -> Result<Vec<(String, String)>> { ... }
}Expand description
Sink for mutating graph operations produced by the executor. Isolates write-side concerns from read-side traversal so we can plug in either a direct-to-storage writer (single-node mode) or a Raft-backed writer that proposes each mutation through consensus (cluster mode).
Methods are sync because the executor’s iterator model is sync.
Async-backed implementations (e.g. the Raft writer) bridge via
Handle::block_on; callers must run the executor inside
spawn_blocking so they don’t stall the tokio runtime.
Required Methods§
fn put_node(&self, node: &Node) -> Result<()>
fn put_edge(&self, edge: &Edge) -> Result<()>
fn delete_edge(&self, id: EdgeId) -> Result<()>
fn detach_delete_node(&self, id: NodeId) -> Result<()>
Provided Methods§
Sourcefn create_property_index(&self, _label: &str, _property: &str) -> Result<()>
fn create_property_index(&self, _label: &str, _property: &str) -> Result<()>
Declare a new property index. Default impl errors so remote writers (Raft, routing) that don’t yet support cluster-aware DDL surface the limitation immediately. Storage-backed writers override this via the blanket impl.
Sourcefn drop_property_index(&self, _label: &str, _property: &str) -> Result<()>
fn drop_property_index(&self, _label: &str, _property: &str) -> Result<()>
Tear down a property index. Mirrors Self::create_property_index.
Implementors§
impl GraphWriter for StorageWriterAdapter<'_>
impl<T: StorageEngine> GraphWriter for T
Blanket impl: any sized type that implements StorageEngine
is automatically a GraphWriter. See the matching
crate::reader::GraphReader blanket for rationale, and
StorageWriterAdapter for the trait-object adapter.