Struct EdgeQuery

Source
pub struct EdgeQuery {
    pub query: String,
    pub args: Option<Value>,
    pub cardinality: Cardinality,
}
Expand description

EgdeQuery represents a edgeDB query.

It combines the string query and its query arguments

query : the string query

args : the query arguments

cardinality : the query cardinality, MANY by default


§Examples

     use edgedb_protocol::codec::ObjectShape;
     use edgedb_protocol::descriptors::{ShapeElement,  TypePos};
     use edgedb_protocol::value::Value;
     use edgedb_protocol::common::Cardinality;
     use edgedb_query::models::edge_query::EdgeQuery;

     let shape: &[ShapeElement] = &[ShapeElement {
         flag_implicit: false,
         flag_link_property: false,
         flag_link: false,
         cardinality: Some(Cardinality::One),
         name: "var".to_string(),
         type_pos: TypePos(0),
     }];
     
     let args = Some(Value::Object {
         shape: ObjectShape::from(shape),
         fields: vec![Some(Value::Str(String::from("Rust")))],
     });

     let query = "Select 'I love ' ++ <str>$var".to_owned();

     let edge_query = EdgeQuery { query, args, cardinality: Cardinality:: One };

Fields§

§query: String§args: Option<Value>§cardinality: Cardinality

Trait Implementations§

Source§

impl Debug for EdgeQuery

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.