pub struct TripleTermSet { /* private fields */ }Expand description
A collection of triple terms with lookup and filtering operations.
Implementations§
Source§impl TripleTermSet
impl TripleTermSet
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Creates a triple term set with the given capacity.
Sourcepub fn insert(&mut self, term: TripleTerm) -> bool
pub fn insert(&mut self, term: TripleTerm) -> bool
Adds a triple term to the set. Returns true if the term was not already present.
Sourcepub fn contains(&self, term: &TripleTerm) -> bool
pub fn contains(&self, term: &TripleTerm) -> bool
Returns true if the set contains the given triple term.
Sourcepub fn iter(&self) -> impl Iterator<Item = &TripleTerm>
pub fn iter(&self) -> impl Iterator<Item = &TripleTerm>
Returns an iterator over the triple terms.
Sourcepub fn filter_by_predicate(&self, predicate_iri: &str) -> Vec<&TripleTerm>
pub fn filter_by_predicate(&self, predicate_iri: &str) -> Vec<&TripleTerm>
Filters triple terms by predicate IRI.
Sourcepub fn filter_by_subject_iri(&self, subject_iri: &str) -> Vec<&TripleTerm>
pub fn filter_by_subject_iri(&self, subject_iri: &str) -> Vec<&TripleTerm>
Filters triple terms by subject IRI.
Sourcepub fn ground_terms(&self) -> Vec<&TripleTerm>
pub fn ground_terms(&self) -> Vec<&TripleTerm>
Returns all ground triple terms (no variables).
Sourcepub fn remove(&mut self, term: &TripleTerm) -> bool
pub fn remove(&mut self, term: &TripleTerm) -> bool
Removes a triple term from the set. Returns true if the term was present.
Sourcepub fn drain(&mut self) -> impl Iterator<Item = TripleTerm> + '_
pub fn drain(&mut self) -> impl Iterator<Item = TripleTerm> + '_
Drains all triple terms from the set.
Sourcepub fn to_triples(&self) -> Vec<Triple>
pub fn to_triples(&self) -> Vec<Triple>
Converts all triple terms to Triples.
Trait Implementations§
Source§impl Clone for TripleTermSet
impl Clone for TripleTermSet
Source§fn clone(&self) -> TripleTermSet
fn clone(&self) -> TripleTermSet
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TripleTermSet
impl Debug for TripleTermSet
Source§impl Default for TripleTermSet
impl Default for TripleTermSet
Source§fn default() -> TripleTermSet
fn default() -> TripleTermSet
Returns the “default value” for a type. Read more
Source§impl FromIterator<TripleTerm> for TripleTermSet
impl FromIterator<TripleTerm> for TripleTermSet
Source§fn from_iter<I: IntoIterator<Item = TripleTerm>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = TripleTerm>>(iter: I) -> Self
Creates a value from an iterator. Read more
Source§impl IntoIterator for TripleTermSet
impl IntoIterator for TripleTermSet
Auto Trait Implementations§
impl Freeze for TripleTermSet
impl RefUnwindSafe for TripleTermSet
impl Send for TripleTermSet
impl Sync for TripleTermSet
impl Unpin for TripleTermSet
impl UnsafeUnpin for TripleTermSet
impl UnwindSafe for TripleTermSet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more