Struct rdftk_memgraph::simple::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.

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 Debug for MemGraph[src]

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

Formats the value using the given formatter. Read more

fn supports_feature(&self, _feature: &IRIRef) -> bool[src]

Return true if this instance, or factory, supports the feature identified by the IRI. Read more

impl Graph for MemGraph[src]

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 matches(
    &self,
    subject: Option<&SubjectNodeRef>,
    predicate: Option<&IRIRef>,
    object: Option<&ObjectNodeRef>
) -> HashSet<&StatementRef>
[src]

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

fn statements<'a>(&'a self) -> Box<dyn Iterator<Item = &'a StatementRef> + 'a>[src]

Return an iterator over all the statements in the graph. 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 prefix_mappings(&self) -> PrefixMappingRef[src]

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

fn set_prefix_mappings(&mut self, mappings: PrefixMappingRef)[src]

Set the prefix mappings held by the graph. Read more

fn factory(&self) -> GraphFactoryRef[src]

Return the factory that creates graphs of this kind. Read more

fn statements_mut<'a>(
    &'a mut self
) -> Box<dyn Iterator<Item = &'a mut StatementRef> + 'a>
[src]

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

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

Insert a new statement into the graph. Read more

fn merge(&mut self, other: &Self)[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. 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

fn contains(&self, statement: &Rc<Statement>) -> bool[src]

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

fn contains_all(
    &self,
    subject: &Rc<SubjectNode>,
    predicate: &Arc<IRI>,
    object: &Rc<ObjectNode>
) -> bool
[src]

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

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

Returns the value factory that is associated with this graph, if present. 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.