Struct rdftk_memgraph::MemGraph[][src]

pub struct MemGraph { /* fields omitted */ }
Expand description

A very simple in-memory implementation of the Graph and NamedGraph traits.

Implementations

impl<'a> MemGraph[src]

pub fn with(&mut self, statements: StatementList) -> &mut Self[src]

Construct a new MemGraph from the list of statements.

pub fn mappings(&mut self, mappings: Rc<dyn PrefixMappings>) -> &mut Self[src]

Construct a new empty MemGraph with the provided mappings.

Trait Implementations

impl Clone for MemGraph[src]

fn clone(&self) -> MemGraph[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<'a> DataSet<'a, MemGraph> for MemDataSet[src]

type GraphIter = Iter<'a, GraphNameRef, MemGraph>

The type used to return an iterator over the graph name/graph pairs in this data set. Read more

fn is_empty(&self) -> bool[src]

Returns true if there are no graphs in this data set, else false. Read more

fn len(&self) -> usize[src]

Return the number of graphs in this data set. Read more

fn has_default_graph(&self) -> bool[src]

Return true if this data set has a default graph, else false. Read more

fn default_graph(&self) -> &Option<MemGraph>[src]

Return the default graph for this data set, if it exists. Read more

fn has_graph_named(&self, name: &GraphNameRef) -> bool[src]

Return true if this data set has a graph with the provided name, else false. Read more

fn graph_named(&self, name: &GraphNameRef) -> Option<&MemGraph>[src]

Return the graph with the provided name from this data set, if it exists. Read more

fn graphs(&'a self) -> Self::GraphIter[src]

Return an iterator over graph name/graph pairs. Read more

fn has_index(&self, _: &DataSetIndex) -> bool[src]

Returns true if this data set has an index of the specified kind, else false. Read more

fn has_indices(&self, indices: &[DataSetIndex]) -> bool[src]

Returns true if this data set has *all the specified index kinds, else false. Read more

impl Debug for MemGraph[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Default for MemGraph[src]

fn default() -> Self[src]

Returns the “default value” for a type. Read more

impl From<MemGraph> for MemDataSet[src]

fn from(v: MemGraph) -> Self[src]

Performs the conversion.

impl From<Vec<Rc<Statement>, Global>> for MemGraph[src]

fn from(sts: StatementList) -> Self[src]

Performs the conversion.

impl From<Vec<Statement, Global>> for MemGraph[src]

fn from(sts: Vec<Statement>) -> Self[src]

Performs the conversion.

impl<'a> Graph<'a> for MemGraph[src]

type StatementIter = Iter<'a, StatementRef>

The type used to return an iterator over the statements in this graph. Read more

type FilteredIter = Filter<Iter<'a, StatementRef>, fn(_: &&StatementRef) -> bool>

The type used to return an filtered iterator over the statements in this graph. Read more

fn is_empty(&self) -> bool[src]

Returns true if there are no statements in this graph, else false. Read more

fn len(&self) -> usize[src]

Return the number of statements in this graph. Read more

fn contains_subject(&self, subject: &SubjectNodeRef) -> bool[src]

Returns true if this graph contains any statement with the provided subject, else false. Read more

fn contains_individual(&self, subject: &IRIRef) -> bool[src]

Returns true if this graph contains any statement with the provided IRI as subject, else false. Read more

fn contains(&self, statement: &StatementRef) -> bool[src]

Returns true if this graph contains the provided statement, else false. Read more

fn contains_all(
    &self,
    subject: &SubjectNodeRef,
    predicate: &IRIRef,
    object: &ObjectNodeRef
) -> bool
[src]

Returns true if this graph contains the any statement with the provided subject, predicate, and object, else false. Read more

fn statements(&'a self) -> Self::StatementIter[src]

Return an iterator over all the statements in the graph. Read more

fn filter(&'a self, filter: fn(_: &&StatementRef) -> bool) -> Self::FilteredIter[src]

Return an iterator over the statements in the graph that match the provided predicate. Read more

fn subjects(&self) -> HashSet<&SubjectNodeRef>[src]

Return a set of all subjects in the graph, note that this is a set so that it removes duplicates. Read more

fn predicates(&self) -> HashSet<&IRIRef>[src]

Return a set of all predicate in the graph, note that this is a set so that it removes duplicates. Read more

fn predicates_for(&self, subject: &SubjectNodeRef) -> HashSet<&IRIRef>[src]

Return a set of all predicate referenced by the provided subject in the graph, note that this is a set so that it removes duplicates. Read more

fn objects(&self) -> HashSet<&ObjectNodeRef>[src]

Return a set of all objects in the graph, note that this is a set so that it removes duplicates. Read more

fn objects_for(
    &self,
    subject: &SubjectNodeRef,
    predicate: &IRIRef
) -> HashSet<&ObjectNodeRef>
[src]

Return a set of all objects referenced by the provided subject and predicate in the graph, note that this is a set so that it removes duplicates. Read more

fn has_index(&self, _: &GraphIndex) -> bool[src]

Returns true if this graph has an index of the specified kind, else false. Read more

fn prefix_mappings(&self) -> Rc<dyn PrefixMappings>[src]

Returns the set of prefix mappings held by the graph. Read more

fn has_indices(&self, indices: &[GraphIndex]) -> bool[src]

Returns true if this graph has *all the specified index kinds, else false. Read more

fn value_factory(&self) -> Option<Rc<dyn ValueFactory + 'static>>[src]

Returns the value factory that is associated with this graph, if present. Read more

impl<'a> MutableDataSet<'a, MemGraph> for MemDataSet[src]

fn set_default_graph(&mut self, graph: MemGraph)[src]

Set the provided graph as the default, unnamed graph, for this data set. Only one graph may be the default. Read more

fn unset_default_graph(&mut self)[src]

Remove any graph that may be set as the current default. This operation has no effect if no default graph is present. Read more

fn insert(&mut self, name: GraphNameRef, graph: MemGraph)[src]

Insert a new graph with it’s associated name into the data set. Read more

fn remove(&mut self, name: &GraphNameRef)[src]

Remove the graph with the provided name from this data set. This operation has no effect if no such graph is present. Read more

fn clear(&mut self)[src]

Remove all graphs from this data set. Read more

impl<'a> MutableGraph<'a> for MemGraph[src]

fn insert(&mut self, statement: StatementRef)[src]

Insert a new statement into the graph. Read more

fn merge(
    &mut self,
    other: &'a Rc<dyn Graph<'a, StatementIter = Self::StatementIter, FilteredIter = Self::FilteredIter>>
)
[src]

Merge another graph into this one. Note that the graphs are required to have the same implementation type based in the type qualifiers for StatementIter and FilteredIter. Read more

fn dedup(&mut self)[src]

Remove any duplicates within the graph, replacing any number of identical statements with just one. Read more

fn remove(&mut self, statement: &StatementRef)[src]

Remove any statement that matches the provided. If a graph has duplicates this method does not differentiate between them. Read more

fn remove_all_for(&mut self, subject: &SubjectNodeRef)[src]

Remove all statements from this graph that have the provided subject. Read more

fn clear(&mut self)[src]

Remove all statements from this graph. Read more

Auto Trait Implementations

impl !RefUnwindSafe for MemGraph

impl !Send for MemGraph

impl !Sync for MemGraph

impl Unpin for MemGraph

impl !UnwindSafe for MemGraph

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.