Skip to main content

MutableDataset

Trait MutableDataset 

Source
pub trait MutableDataset: Dataset {
    type GraphsMut<'a>: Iterator<Item = (Option<&'a Self::GraphLabel>, &'a mut Self::Graph)>
       where Self: 'a;

    // Required methods
    fn graph_mut(
        &mut self,
        id: Option<&Self::GraphLabel>,
    ) -> Option<&mut Self::Graph>;
    fn graphs_mut(&mut self) -> Self::GraphsMut<'_>;
    fn insert_graph(
        &mut self,
        id: Self::GraphLabel,
        graph: Self::Graph,
    ) -> Option<Self::Graph>;
    fn insert(
        &mut self,
        quad: Quad<Self::Subject, Self::Predicate, Self::Object, Self::GraphLabel>,
    ) -> bool;
    fn remove(
        &mut self,
        quad: Quad<&Self::Subject, &Self::Predicate, &Self::Object, &Self::GraphLabel>,
    );
    fn absorb<D: SizedDataset<Subject = Self::Subject, Predicate = Self::Predicate, Object = Self::Object, GraphLabel = Self::GraphLabel>>(
        &mut self,
        other: D,
    )
       where D::Graph: SizedGraph;

    // Provided method
    fn default_graph_mut(&mut self) -> &mut Self::Graph { ... }
}
Expand description

Mutable dataset.

Required Associated Types§

Source

type GraphsMut<'a>: Iterator<Item = (Option<&'a Self::GraphLabel>, &'a mut Self::Graph)> where Self: 'a

Iterator over mutable graphs.

Required Methods§

Source

fn graph_mut( &mut self, id: Option<&Self::GraphLabel>, ) -> Option<&mut Self::Graph>

Get the given graph mutably.

Use the input None to get the default graph.

Note to implementors: the default graph should always exists.

Source

fn graphs_mut(&mut self) -> Self::GraphsMut<'_>

Returns an iterator over the (mutable) graphs of the dataset.

Source

fn insert_graph( &mut self, id: Self::GraphLabel, graph: Self::Graph, ) -> Option<Self::Graph>

Insert a graph in the dataset with the given name.

If a graph with the given name already exists, it is replaced and the previous graph definition is returned.

Source

fn insert( &mut self, quad: Quad<Self::Subject, Self::Predicate, Self::Object, Self::GraphLabel>, ) -> bool

Insert a quad in the dataset.

Source

fn remove( &mut self, quad: Quad<&Self::Subject, &Self::Predicate, &Self::Object, &Self::GraphLabel>, )

Remove a quad from the dataset.

Source

fn absorb<D: SizedDataset<Subject = Self::Subject, Predicate = Self::Predicate, Object = Self::Object, GraphLabel = Self::GraphLabel>>( &mut self, other: D, )
where D::Graph: SizedGraph,

Absorb the given other dataset.

Adds all the quads of other in the dataset.

Provided Methods§

Source

fn default_graph_mut(&mut self) -> &mut Self::Graph

Get the default graph mutably.

Note to implementors: the default graph should always exists.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl<S: Eq + Hash, P: Eq + Hash, O: Eq + Hash, G: Eq + Hash> MutableDataset for HashDataset<S, P, O, G>

Source§

type GraphsMut<'a> = GraphsMut<'a, S, P, O, G> where Self: 'a, S: 'a, P: 'a, O: 'a, G: 'a

Source§

impl<S: Ord, P: Ord, O: Ord, G: Ord> MutableDataset for BTreeDataset<S, P, O, G>

Source§

type GraphsMut<'a> = GraphsMut<'a, S, P, O, G> where Self: 'a, S: 'a, P: 'a, O: 'a, G: 'a