ImportOps

Trait ImportOps 

Source
pub trait ImportOps: Sized {
    // Required methods
    fn import_node<'a, GHH: GraphViewOps<'a>, GH: GraphViewOps<'a>>(
        &self,
        node: &NodeView<'a, GHH, GH>,
        merge: bool,
    ) -> Result<NodeView<'static, Self, Self>, GraphError>;
    fn import_node_as<'a, GHH: GraphViewOps<'a>, GH: GraphViewOps<'a>, V: AsNodeRef + Clone + Debug>(
        &self,
        node: &NodeView<'a, GHH, GH>,
        new_id: V,
        merge: bool,
    ) -> Result<NodeView<'static, Self, Self>, GraphError>;
    fn import_nodes<'a, GHH: GraphViewOps<'a>, GH: GraphViewOps<'a>>(
        &self,
        nodes: impl IntoIterator<Item = impl Borrow<NodeView<'a, GHH, GH>>>,
        merge: bool,
    ) -> Result<(), GraphError>;
    fn import_nodes_as<'a, GHH: GraphViewOps<'a>, GH: GraphViewOps<'a>, V: AsNodeRef + Clone + Debug>(
        &self,
        nodes: impl IntoIterator<Item = impl Borrow<NodeView<'a, GHH, GH>>>,
        new_ids: impl IntoIterator<Item = V>,
        merge: bool,
    ) -> Result<(), GraphError>;
    fn import_edge<'a, GHH: GraphViewOps<'a>, GH: GraphViewOps<'a>>(
        &self,
        edge: &EdgeView<GHH, GH>,
        merge: bool,
    ) -> Result<EdgeView<Self, Self>, GraphError>;
    fn import_edge_as<'a, GHH: GraphViewOps<'a>, GH: GraphViewOps<'a>, V: AsNodeRef + Clone + Debug>(
        &self,
        edge: &EdgeView<GHH, GH>,
        new_id: (V, V),
        merge: bool,
    ) -> Result<EdgeView<Self, Self>, GraphError>;
    fn import_edges<'a, GHH: GraphViewOps<'a>, GH: GraphViewOps<'a>>(
        &self,
        edges: impl IntoIterator<Item = impl Borrow<EdgeView<GHH, GH>>>,
        merge: bool,
    ) -> Result<(), GraphError>;
    fn import_edges_as<'a, GHH: GraphViewOps<'a>, GH: GraphViewOps<'a>, V: AsNodeRef + Clone + Debug>(
        &self,
        edges: impl IntoIterator<Item = impl Borrow<EdgeView<GHH, GH>>>,
        new_ids: impl IntoIterator<Item = (V, V)>,
        merge: bool,
    ) -> Result<(), GraphError>;
}

Required Methods§

Source

fn import_node<'a, GHH: GraphViewOps<'a>, GH: GraphViewOps<'a>>( &self, node: &NodeView<'a, GHH, GH>, merge: bool, ) -> Result<NodeView<'static, Self, Self>, GraphError>

Imports a single node into the graph.

§Arguments
  • node - A reference to the node to be imported.
  • merge - An optional boolean flag. If merge is false, the function will return an error if the imported node already exists in the graph. If merge is true, the function merges the histories of the imported node and the existing node (in the graph).
§Returns

A Result which is Ok if the node was successfully imported, and Err otherwise.

Source

fn import_node_as<'a, GHH: GraphViewOps<'a>, GH: GraphViewOps<'a>, V: AsNodeRef + Clone + Debug>( &self, node: &NodeView<'a, GHH, GH>, new_id: V, merge: bool, ) -> Result<NodeView<'static, Self, Self>, GraphError>

Imports a single node into the graph.

§Arguments
  • node - A reference to the node to be imported.
  • new_id - The new node id.
  • merge - An optional boolean flag. If merge is false, the function will return an error if the imported node already exists in the graph. If merge is true, the function merges the histories of the imported node and the existing node (in the graph).
§Returns

A Result which is Ok if the node was successfully imported, and Err otherwise.

Source

fn import_nodes<'a, GHH: GraphViewOps<'a>, GH: GraphViewOps<'a>>( &self, nodes: impl IntoIterator<Item = impl Borrow<NodeView<'a, GHH, GH>>>, merge: bool, ) -> Result<(), GraphError>

Imports multiple nodes into the graph.

§Arguments
  • nodes - A vector of references to the nodes to be imported.
  • merge - An optional boolean flag. If merge is false, the function will return an error if any of the imported nodes already exists in the graph. If merge is true, the function merges the histories of the imported nodes and the existing nodes (in the graph).

Returns: Ok(()) if the nodes were successfully imported. Err(GraphError) if the operation fails.

Source

fn import_nodes_as<'a, GHH: GraphViewOps<'a>, GH: GraphViewOps<'a>, V: AsNodeRef + Clone + Debug>( &self, nodes: impl IntoIterator<Item = impl Borrow<NodeView<'a, GHH, GH>>>, new_ids: impl IntoIterator<Item = V>, merge: bool, ) -> Result<(), GraphError>

Imports multiple nodes into the graph.

Arguments: nodes: A list of nodes to be imported. new_ids: A list of node IDs to use for the imported nodes. merge: An optional boolean flag. If merge is false, the function will return an error if any of the imported nodes already exists in the graph. If merge is true, the function merges the histories of the imported nodes and the existing nodes (in the graph).

Returns: Ok(()) if the nodes were successfully imported. Err(GraphError) if the operation fails.

Source

fn import_edge<'a, GHH: GraphViewOps<'a>, GH: GraphViewOps<'a>>( &self, edge: &EdgeView<GHH, GH>, merge: bool, ) -> Result<EdgeView<Self, Self>, GraphError>

Imports a single edge into the graph.

§Arguments
  • edge - A reference to the edge to be imported.
  • merge - An optional boolean flag. If merge is false, the function will return an error if the imported edge already exists in the graph. If merge is true, the function merges the histories of the imported edge and the existing edge (in the graph).

Returns: Ok(()) if the edge were successfully imported. Err(GraphError) if the operation fails.

Source

fn import_edge_as<'a, GHH: GraphViewOps<'a>, GH: GraphViewOps<'a>, V: AsNodeRef + Clone + Debug>( &self, edge: &EdgeView<GHH, GH>, new_id: (V, V), merge: bool, ) -> Result<EdgeView<Self, Self>, GraphError>

Imports a single edge into the graph.

§Arguments
  • edge - A reference to the edge to be imported.
  • new_id - The ID of the new edge. It’s a tuple of the source and destination node ids.
  • merge - An optional boolean flag. If merge is false, the function will return an error if the imported edge already exists in the graph. If merge is true, the function merges the histories of the imported edge and the existing edge (in the graph).

Returns: Ok(()) if the edge were successfully imported. Err(GraphError) if the operation fails.

Source

fn import_edges<'a, GHH: GraphViewOps<'a>, GH: GraphViewOps<'a>>( &self, edges: impl IntoIterator<Item = impl Borrow<EdgeView<GHH, GH>>>, merge: bool, ) -> Result<(), GraphError>

Imports multiple edges into the graph.

§Arguments
  • edges - A vector of references to the edges to be imported.
  • merge - An optional boolean flag. If merge is false, the function will return an error if any of the imported edges already exists in the graph. If merge is true, the function merges the histories of the imported edges and the existing edges (in the graph).

Returns: Ok(()) if the edges were successfully imported. Err(GraphError) if the operation fails.

Source

fn import_edges_as<'a, GHH: GraphViewOps<'a>, GH: GraphViewOps<'a>, V: AsNodeRef + Clone + Debug>( &self, edges: impl IntoIterator<Item = impl Borrow<EdgeView<GHH, GH>>>, new_ids: impl IntoIterator<Item = (V, V)>, merge: bool, ) -> Result<(), GraphError>

Imports multiple edges into the graph.

§Arguments
  • edges - A vector of references to the edges to be imported.
  • new_ids - The IDs of the new edges. It’s a vector of tuples of the source and destination node ids.
  • merge - An optional boolean flag. If merge is false, the function will return an error if any of the imported edges already exists in the graph. If merge is true, the function merges the histories of the imported edges and the existing edges (in the graph).

Returns: Ok(()) if the edges were successfully imported. Err(GraphError) if the operation fails.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§