Skip to main content

BTreeGraph

Struct BTreeGraph 

Source
pub struct BTreeGraph<R> { /* private fields */ }
Expand description

BTree-based RDF graph.

Implementations§

Source§

impl<R> BTreeGraph<R>

Source

pub fn new() -> BTreeGraph<R>

Creates a new empty graph.

Source

pub fn len(&self) -> usize

Returns the number of triples in the graph.

Source

pub fn is_empty(&self) -> bool

Checks if the graph is empty.

Source

pub fn iter(&self) -> Iter<'_, R>

Returns an iterator over the triples of the graph.

Source

pub fn resources(&self) -> Resources<'_, R>

Returns an iterator over the resources of the graph.

Source

pub fn into_indexed(self) -> IndexedBTreeGraph<R>

Indexes the triples to allow more operation on this graph, such as pattern matching using the PatternMatchingGraph trait.

Source§

impl<R> BTreeGraph<R>
where R: Ord,

Source

pub fn contains_resource(&self, resource: &R) -> bool

Checks if the provided resource appears in any triple in the graph.

Source

pub fn contains(&self, triple: Triple<&R>) -> bool

Checks if the provided triple is in the graph.

Source

pub fn insert(&mut self, triple: Triple<R>) -> bool

Inserts the given triple in the graph.

Returns true if the triple was not already in the graph, and false if it was.

Source

pub fn remove(&mut self, triple: Triple<&R>) -> bool

Removes the given triple from the graph.

Returns whether or not the triple was in the graph. Does nothing if the triple was not in the graph.

Trait Implementations§

Source§

impl<R> Clone for BTreeGraph<R>
where R: Clone,

Source§

fn clone(&self) -> BTreeGraph<R>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<R> Debug for BTreeGraph<R>
where R: Debug,

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<R> Default for BTreeGraph<R>

Source§

fn default() -> BTreeGraph<R>

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

impl<R> Eq for BTreeGraph<R>
where R: Eq,

Source§

impl<R> Extend<Triple<R>> for BTreeGraph<R>
where R: Clone + Ord,

Source§

fn extend<T>(&mut self, iter: T)
where T: IntoIterator<Item = Triple<R>>,

Extends a collection with the contents of an iterator. Read more
Source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
Source§

impl<R> FiniteGraph for BTreeGraph<R>

Source§

type Triples<'a> = Iter<'a, R> where R: 'a

Triples iterator.
Source§

fn triples(&self) -> <BTreeGraph<R> as FiniteGraph>::Triples<'_>

Returns an iterator over the triples of the graph.
Source§

fn triples_count(&self) -> usize

Returns the number of triples in the graph.
Source§

impl<R> From<BTreeGraph<R>> for IndexedBTreeGraph<R>

Source§

fn from(value: BTreeGraph<R>) -> IndexedBTreeGraph<R>

Converts to this type from the input type.
Source§

impl<R> FromIterator<Triple<R>> for BTreeGraph<R>
where R: Clone + Ord,

Source§

fn from_iter<T>(iter: T) -> BTreeGraph<R>
where T: IntoIterator<Item = Triple<R>>,

Creates a value from an iterator. Read more
Source§

impl<R> Graph for BTreeGraph<R>

Source§

type Resource = R

Resource type.
Source§

impl<R> GraphMut for BTreeGraph<R>
where R: Clone + Ord,

Source§

fn insert(&mut self, triple: Triple<<BTreeGraph<R> as Graph>::Resource>)

Inserts the given triple in the graph.
Source§

fn remove(&mut self, triple: Triple<&<BTreeGraph<R> as Graph>::Resource>)

Removes the given triple from the graph.
Source§

impl<R> Hash for BTreeGraph<R>
where R: Hash,

Source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<'a, R> IntoIterator for &'a BTreeGraph<R>

Source§

type Item = Triple<&'a R>

The type of the elements being iterated over.
Source§

type IntoIter = Iter<'a, R>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> <&'a BTreeGraph<R> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
Source§

impl<R> IntoIterator for BTreeGraph<R>
where R: Clone,

Source§

type Item = Triple<R>

The type of the elements being iterated over.
Source§

type IntoIter = IntoIter<R>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> <BTreeGraph<R> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
Source§

impl<R> Ord for BTreeGraph<R>
where R: Ord,

Source§

fn cmp(&self, other: &BTreeGraph<R>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<R> PartialEq for BTreeGraph<R>
where R: PartialEq,

Source§

fn eq(&self, other: &BTreeGraph<R>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<R> PartialOrd for BTreeGraph<R>
where R: PartialOrd,

Source§

fn partial_cmp(&self, other: &BTreeGraph<R>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<R: RdfDisplay> RdfDisplay for BTreeGraph<R>

Source§

fn rdf_fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
Source§

fn rdf_display(&self) -> RdfDisplayed<&Self>

Prepare the value to be formatted as an RDF syntax element.
Source§

impl<R> ResourceFiniteGraph for BTreeGraph<R>

Source§

type GraphResources<'a> = Resources<'a, R> where R: 'a

Resources iterator.
Source§

fn graph_resources( &self, ) -> <BTreeGraph<R> as ResourceFiniteGraph>::GraphResources<'_>

Returns an iterator over the distinct resources of the graph.
Source§

fn graph_resource_count(&self) -> usize

Returns the number of distinct resources in the graph.

Auto Trait Implementations§

§

impl<R> Freeze for BTreeGraph<R>

§

impl<R> RefUnwindSafe for BTreeGraph<R>
where R: RefUnwindSafe,

§

impl<R> Send for BTreeGraph<R>
where R: Send,

§

impl<R> Sync for BTreeGraph<R>
where R: Sync,

§

impl<R> Unpin for BTreeGraph<R>
where R: Unpin,

§

impl<R> UnsafeUnpin for BTreeGraph<R>

§

impl<R> UnwindSafe for BTreeGraph<R>
where R: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<D> AsyncFiniteDataset for D

Source§

type AsyncQuads<'a> = Iter<<D as TryFiniteDataset>::TryQuads<'a>> where D: 'a

Asynchronous fallible quads stream.
Source§

async fn async_quads( &self, ) -> Result<<D as AsyncFiniteDataset>::AsyncQuads<'_>, <D as TryDataset>::Error>

Returns a stream over the quads of the dataset.
Source§

impl<D> AsyncFiniteGraph for D
where D: TryFiniteGraph,

Source§

type AsyncTriples<'a> = Iter<<D as TryFiniteGraph>::TryTriples<'a>> where D: 'a

Asynchronous fallible triples stream.
Source§

async fn async_triples( &self, ) -> Result<<D as AsyncFiniteGraph>::AsyncTriples<'_>, <D as TryGraph>::Error>

Returns a stream over the triples of the graph.
Source§

impl<D> AsyncGraphMut for D
where D: TryGraphMut,

Source§

async fn async_insert( &mut self, triple: Triple<<D as TryGraph>::Resource>, ) -> Result<(), <D as TryGraph>::Error>

Inserts the given triple in the graph.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<G> Dataset for G
where G: Graph,

Source§

type Resource = <G as Graph>::Resource

Resource type.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<G> FiniteDataset for G
where G: FiniteGraph,

Source§

type Quads<'a> = TriplesIntoQuads<<G as FiniteGraph>::Triples<'a>, &'a <G as Graph>::Resource> where G: 'a

Quads iterator.
Source§

fn quads(&self) -> <G as FiniteDataset>::Quads<'_>

Returns an iterator over the quads of the dataset.
Source§

fn quads_count(&self) -> usize

Returns the number of quads in the dataset.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<G> NamedGraphFiniteDataset for G
where G: Graph,

Source§

type NamedGraphs<'a> = Empty<&'a <G as Dataset>::Resource> where G: 'a

Named graphs iterator.
Source§

fn named_graphs(&self) -> <G as NamedGraphFiniteDataset>::NamedGraphs<'_>

Returns an iterator over the distinct named graphs of the dataset.
Source§

fn named_graph_count(&self) -> usize

Returns the number of distinct named graphs in the dataset.
Source§

impl<G> ResourceFiniteDataset for G

Source§

type Resources<'a> = <G as ResourceFiniteGraph>::GraphResources<'a> where G: 'a

Resources iterator.
Source§

fn resources(&self) -> <G as ResourceFiniteDataset>::Resources<'_>

Returns an iterator over the distinct resources of the dataset.
Source§

fn resource_count(&self) -> usize

Returns the number of distinct resources in the dataset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<D> TryDataset for D
where D: Dataset,

Source§

type Resource = <D as Dataset>::Resource

Resource type.
Source§

type Error = Infallible

Error type.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<D> TryGraph for D
where D: Graph,

Source§

type Resource = <D as Graph>::Resource

Resource type.
Source§

type Error = Infallible

Error type.
Source§

impl<D> TryGraphMut for D
where D: GraphMut,

Source§

fn try_insert( &mut self, triple: Triple<<D as TryGraph>::Resource>, ) -> Result<(), <D as TryGraph>::Error>

Tries to insert the given triple in the graph.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.