pub enum AnySubjectAnyPredicate<T> {
AnyObject(AnySubjectAnyPredicateAnyObject<T>),
SameAsSubject(AnySubjectAnyPredicateGivenObject<T>),
SameAsPredicate(AnySubjectAnyPredicateGivenObject<T>),
GivenObject(T, AnySubjectAnyPredicateGivenObject<T>),
}Expand description
Canonical quad pattern matching any subject, any predicate.
Variants§
AnyObject(AnySubjectAnyPredicateAnyObject<T>)
Any object.
SameAsSubject(AnySubjectAnyPredicateGivenObject<T>)
A object equal to the subject.
SameAsPredicate(AnySubjectAnyPredicateGivenObject<T>)
A object equal to the predicate.
GivenObject(T, AnySubjectAnyPredicateGivenObject<T>)
A given object.
Implementations§
Source§impl<T> AnySubjectAnyPredicate<T>
impl<T> AnySubjectAnyPredicate<T>
Sourcepub fn from_option(o: Option<T>, g: Option<Option<T>>) -> Self
pub fn from_option(o: Option<T>, g: Option<Option<T>>) -> Self
Builds a pattern whose unset positions match anything.
Sourcepub fn from_pattern<X: PartialEq>(
s: X,
p: X,
o: ResourceOrVar<T, X>,
g: Option<ResourceOrVar<T, X>>,
) -> Self
pub fn from_pattern<X: PartialEq>( s: X, p: X, o: ResourceOrVar<T, X>, g: Option<ResourceOrVar<T, X>>, ) -> Self
Builds a pattern from pattern, canonicalizing repeated
variables into SameAs positions.
Sourcepub const fn object(&self) -> PatternObject<&T>
pub const fn object(&self) -> PatternObject<&T>
Returns the object of this pattern.
Sourcepub fn into_object(self) -> PatternObject<T>
pub fn into_object(self) -> PatternObject<T>
Consumes this pattern, returning its object.
Sourcepub const fn graph(&self) -> PatternGraph<&T>
pub const fn graph(&self) -> PatternGraph<&T>
Returns the graph of this pattern.
Sourcepub fn into_graph(self) -> PatternGraph<T>
pub fn into_graph(self) -> PatternGraph<T>
Consumes this pattern, returning its graph.
Sourcepub const fn as_ref(&self) -> AnySubjectAnyPredicate<&T>
pub const fn as_ref(&self) -> AnySubjectAnyPredicate<&T>
Borrows the resources of this pattern.
Sourcepub fn map<U>(self, f: impl FnMut(T) -> U) -> AnySubjectAnyPredicate<U>
pub fn map<U>(self, f: impl FnMut(T) -> U) -> AnySubjectAnyPredicate<U>
Maps the resources of this pattern with f.
Sourcepub fn map2<U, V>(
self,
f: impl FnMut(T) -> (U, V),
) -> (AnySubjectAnyPredicate<U>, AnySubjectAnyPredicate<V>)
pub fn map2<U, V>( self, f: impl FnMut(T) -> (U, V), ) -> (AnySubjectAnyPredicate<U>, AnySubjectAnyPredicate<V>)
Maps each resource to a pair with f, splitting this pattern in two.
Sourcepub fn into_triple(self) -> (AnySubjectAnyPredicate<T>, PatternGraph<T>)
pub fn into_triple(self) -> (AnySubjectAnyPredicate<T>, PatternGraph<T>)
Splits this quad pattern into a triple pattern and a graph pattern.
Sourcepub fn into_parts(self) -> (PatternObject<T>, PatternGraph<T>)
pub fn into_parts(self) -> (PatternObject<T>, PatternGraph<T>)
Consumes this pattern, returning each position separately.
Trait Implementations§
Source§impl<T: Clone> Clone for AnySubjectAnyPredicate<T>
impl<T: Clone> Clone for AnySubjectAnyPredicate<T>
Source§fn clone(&self) -> AnySubjectAnyPredicate<T>
fn clone(&self) -> AnySubjectAnyPredicate<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<T: Copy> Copy for AnySubjectAnyPredicate<T>
Source§impl<T: Debug> Debug for AnySubjectAnyPredicate<T>
impl<T: Debug> Debug for AnySubjectAnyPredicate<T>
impl<T: Eq> Eq for AnySubjectAnyPredicate<T>
Source§impl<T: Hash> Hash for AnySubjectAnyPredicate<T>
impl<T: Hash> Hash for AnySubjectAnyPredicate<T>
Source§impl<T: Ord> Ord for AnySubjectAnyPredicate<T>
impl<T: Ord> Ord for AnySubjectAnyPredicate<T>
Source§fn cmp(&self, other: &AnySubjectAnyPredicate<T>) -> Ordering
fn cmp(&self, other: &AnySubjectAnyPredicate<T>) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T: PartialEq> PartialEq for AnySubjectAnyPredicate<T>
impl<T: PartialEq> PartialEq for AnySubjectAnyPredicate<T>
Source§impl<T: PartialOrd> PartialOrd for AnySubjectAnyPredicate<T>
impl<T: PartialOrd> PartialOrd for AnySubjectAnyPredicate<T>
impl<T: PartialEq> StructuralPartialEq for AnySubjectAnyPredicate<T>
Auto Trait Implementations§
impl<T> Freeze for AnySubjectAnyPredicate<T>where
T: Freeze,
impl<T> RefUnwindSafe for AnySubjectAnyPredicate<T>where
T: RefUnwindSafe,
impl<T> Send for AnySubjectAnyPredicate<T>where
T: Send,
impl<T> Sync for AnySubjectAnyPredicate<T>where
T: Sync,
impl<T> Unpin for AnySubjectAnyPredicate<T>where
T: Unpin,
impl<T> UnsafeUnpin for AnySubjectAnyPredicate<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for AnySubjectAnyPredicate<T>where
T: UnwindSafe,
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.