pub enum GraphParam {
Str(String),
Int(i64),
Float(f64),
}Expand description
A typed value bound to a Cypher query parameter.
Carries the value and its kind so the backend can render each parameter as
the correct Cypher literal: strings are quoted and escaped, numbers stay
bare. The kind cannot be recovered from a plain string once erased — a
LIMIT needs the bare integer 500, while a name needs the quoted literal
'Alice' — so callers state the kind at the bind site rather than letting
the backend guess.
FalkorDB’s parameter mechanism textually substitutes CYPHER key=value into
the query, so the rendered form must be a valid Cypher literal; this enum is
what makes that rendering type-directed instead of a fragile heuristic.
Variants§
Str(String)
A string value, rendered as a quoted, escaped Cypher string literal.
Int(i64)
An integer value, rendered bare (e.g. for LIMIT).
Float(f64)
A floating-point value, rendered bare.
Implementations§
Source§impl GraphParam
impl GraphParam
Sourcepub fn to_cypher_literal(&self) -> String
pub fn to_cypher_literal(&self) -> String
Renders the value as a Cypher literal safe to substitute into a query.
GraphParam::Str is wrapped in single quotes with embedded backslashes
and single quotes escaped, so a value drawn from user content (an entity
name, a memory id) cannot break out of the literal. Numeric variants
render to their bare textual form.
Trait Implementations§
Source§impl Clone for GraphParam
impl Clone for GraphParam
Source§fn clone(&self) -> GraphParam
fn clone(&self) -> GraphParam
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GraphParam
impl Debug for GraphParam
Source§impl From<&str> for GraphParam
impl From<&str> for GraphParam
Source§impl From<String> for GraphParam
impl From<String> for GraphParam
Source§impl PartialEq for GraphParam
impl PartialEq for GraphParam
Source§fn eq(&self, other: &GraphParam) -> bool
fn eq(&self, other: &GraphParam) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for GraphParam
Auto Trait Implementations§
impl Freeze for GraphParam
impl RefUnwindSafe for GraphParam
impl Send for GraphParam
impl Sync for GraphParam
impl Unpin for GraphParam
impl UnsafeUnpin for GraphParam
impl UnwindSafe for GraphParam
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<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> 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>
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>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request