pub enum AnySubject<T> {
AnyPredicate(AnySubjectAnyPredicate<T>),
SameAsSubject(AnySubjectGivenPredicate<T>),
GivenPredicate(T, AnySubjectGivenPredicate<T>),
}Expand description
Canonical quad pattern matching any subject.
Variants§
AnyPredicate(AnySubjectAnyPredicate<T>)
Any predicate.
SameAsSubject(AnySubjectGivenPredicate<T>)
A predicate equal to the subject.
GivenPredicate(T, AnySubjectGivenPredicate<T>)
A given predicate.
Implementations§
Source§impl<T> AnySubject<T>
impl<T> AnySubject<T>
Sourcepub fn from_option_quad(
p: Option<T>,
o: Option<T>,
g: Option<Option<T>>,
) -> Self
pub fn from_option_quad( p: Option<T>, o: Option<T>, g: Option<Option<T>>, ) -> Self
Builds a pattern from a quad whose unset positions match anything.
Sourcepub fn from_pattern<X: PartialEq>(
s: X,
p: ResourceOrVar<T, X>,
o: ResourceOrVar<T, X>,
g: Option<ResourceOrVar<T, X>>,
) -> Self
pub fn from_pattern<X: PartialEq>( s: X, p: ResourceOrVar<T, 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 predicate(&self) -> PatternPredicate<&T>
pub const fn predicate(&self) -> PatternPredicate<&T>
Returns the predicate of this pattern.
Sourcepub fn into_predicate(self) -> PatternPredicate<T>
pub fn into_predicate(self) -> PatternPredicate<T>
Consumes this pattern, returning its predicate.
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) -> AnySubject<&T>
pub const fn as_ref(&self) -> AnySubject<&T>
Borrows the resources of this pattern.
Sourcepub fn map<U>(self, f: impl FnMut(T) -> U) -> AnySubject<U>
pub fn map<U>(self, f: impl FnMut(T) -> U) -> AnySubject<U>
Maps the resources of this pattern with f.
Sourcepub fn map2<U, V>(
self,
f: impl FnMut(T) -> (U, V),
) -> (AnySubject<U>, AnySubject<V>)
pub fn map2<U, V>( self, f: impl FnMut(T) -> (U, V), ) -> (AnySubject<U>, AnySubject<V>)
Maps each resource to a pair with f, splitting this pattern in two.
Sourcepub fn into_triple(self) -> (AnySubject<T>, PatternGraph<T>)
pub fn into_triple(self) -> (AnySubject<T>, PatternGraph<T>)
Splits this quad pattern into a triple pattern and a graph pattern.
Sourcepub fn into_parts(
self,
) -> (PatternPredicate<T>, PatternObject<T>, PatternGraph<T>)
pub fn into_parts( self, ) -> (PatternPredicate<T>, PatternObject<T>, PatternGraph<T>)
Consumes this pattern, returning each position separately.
Trait Implementations§
Source§impl<T: Clone> Clone for AnySubject<T>
impl<T: Clone> Clone for AnySubject<T>
Source§fn clone(&self) -> AnySubject<T>
fn clone(&self) -> AnySubject<T>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<T: Copy> Copy for AnySubject<T>
Source§impl<T: Debug> Debug for AnySubject<T>
impl<T: Debug> Debug for AnySubject<T>
impl<T: Eq> Eq for AnySubject<T>
Source§impl<T: Hash> Hash for AnySubject<T>
impl<T: Hash> Hash for AnySubject<T>
Source§impl<T: Ord> Ord for AnySubject<T>
impl<T: Ord> Ord for AnySubject<T>
Source§fn cmp(&self, other: &AnySubject<T>) -> Ordering
fn cmp(&self, other: &AnySubject<T>) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl<T: PartialEq> PartialEq for AnySubject<T>
impl<T: PartialEq> PartialEq for AnySubject<T>
Source§impl<T: PartialOrd> PartialOrd for AnySubject<T>
impl<T: PartialOrd> PartialOrd for AnySubject<T>
impl<T: PartialEq> StructuralPartialEq for AnySubject<T>
Auto Trait Implementations§
impl<T> Freeze for AnySubject<T>where
T: Freeze,
impl<T> RefUnwindSafe for AnySubject<T>where
T: RefUnwindSafe,
impl<T> Send for AnySubject<T>where
T: Send,
impl<T> Sync for AnySubject<T>where
T: Sync,
impl<T> Unpin for AnySubject<T>where
T: Unpin,
impl<T> UnsafeUnpin for AnySubject<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for AnySubject<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
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
key and return true if they are equal.