Skip to main content

ExportSource

Trait ExportSource 

Source
pub trait ExportSource {
    // Required methods
    fn for_each_node(
        &self,
        each: &mut dyn FnMut(NodeInfo) -> Result<(), CliError>,
    ) -> Result<(), CliError>;
    fn for_each_edge(
        &self,
        each: &mut dyn FnMut(ExportEdge) -> Result<(), CliError>,
    ) -> Result<(), CliError>;
    fn label_of(&self, key: &str) -> Option<String>;

    // Provided method
    fn for_each_edge_with_props(
        &self,
        each: &mut dyn FnMut(ExportEdge, BTreeMap<String, Value>) -> Result<(), CliError>,
    ) -> Result<(), CliError> { ... }
}
Expand description

Where an export reads the store from: node by node and edge by edge, so an export holds one record at a time (see mushroomdb::GraphDb::for_each_node_for_export). Nodes arrive sorted by key and edges by (edge_type, src, dst).

Required Methods§

Source

fn for_each_node( &self, each: &mut dyn FnMut(NodeInfo) -> Result<(), CliError>, ) -> Result<(), CliError>

Source

fn for_each_edge( &self, each: &mut dyn FnMut(ExportEdge) -> Result<(), CliError>, ) -> Result<(), CliError>

Source

fn label_of(&self, key: &str) -> Option<String>

The label of the node key.

Provided Methods§

Source

fn for_each_edge_with_props( &self, each: &mut dyn FnMut(ExportEdge, BTreeMap<String, Value>) -> Result<(), CliError>, ) -> Result<(), CliError>

Iterate over edges paired with their property maps (QL-RP, row 120).

Default impl delegates to for_each_edge with an empty property map; override to supply real properties (e.g. from GraphDb::all_edges_with_props_for_export).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ExportSource for GraphDb<RealFs>

Implementors§