pub struct PatternTriple {
pub start_label: Option<String>,
pub edge_type: String,
pub end_label: Option<String>,
pub start_props: HashMap<String, String>,
pub end_props: HashMap<String, String>,
pub direction: BackendDirection,
}Expand description
A lightweight triple pattern for basic graph pattern matching.
Represents a single-hop pattern: (start_label)-[edge_type]->(end_label) with optional property filters on start and end nodes.
Fields§
§start_label: Option<String>Optional label filter for the start node
edge_type: StringEdge type to match (required)
end_label: Option<String>Optional label filter for the end node
start_props: HashMap<String, String>Optional property filters for the start node (key -> value)
end_props: HashMap<String, String>Optional property filters for the end node (key -> value)
direction: BackendDirectionDirection of the pattern (default: Outgoing)
Implementations§
Source§impl PatternTriple
impl PatternTriple
Sourcepub fn new(edge_type: impl Into<String>) -> Self
pub fn new(edge_type: impl Into<String>) -> Self
Create a new pattern triple with the given edge type.
Sourcepub fn start_label(self, label: impl Into<String>) -> Self
pub fn start_label(self, label: impl Into<String>) -> Self
Set the start node label filter.
Sourcepub fn start_property(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn start_property( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
Add a property filter for the start node.
Sourcepub fn end_property(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn end_property( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
Add a property filter for the end node.
Sourcepub fn direction(self, direction: BackendDirection) -> Self
pub fn direction(self, direction: BackendDirection) -> Self
Set the direction of the pattern.
Sourcepub fn validate(&self) -> Result<(), SqliteGraphError>
pub fn validate(&self) -> Result<(), SqliteGraphError>
Validate that the pattern is well-formed.
Trait Implementations§
Source§impl Clone for PatternTriple
impl Clone for PatternTriple
Source§fn clone(&self) -> PatternTriple
fn clone(&self) -> PatternTriple
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 PatternTriple
impl Debug for PatternTriple
Source§impl Default for PatternTriple
impl Default for PatternTriple
Source§impl PartialEq for PatternTriple
impl PartialEq for PatternTriple
impl Eq for PatternTriple
impl StructuralPartialEq for PatternTriple
Auto Trait Implementations§
impl Freeze for PatternTriple
impl RefUnwindSafe for PatternTriple
impl Send for PatternTriple
impl Sync for PatternTriple
impl Unpin for PatternTriple
impl UnwindSafe for PatternTriple
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> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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