Struct GraphHostBinding

Source
pub struct GraphHostBinding { /* private fields */ }

Implementations§

Source§

impl GraphHostBinding

Source

pub fn query<T: FromTable>(&self, query: &str) -> Result<T, Box<dyn Error>>

Executes a query against the host graph. For this provider, we assume the query is a Cypher query but it could be Gremlin or GraphQL, etc, depending on the capability provider satisfying wascc:graphdb. This can be used to perform mutations if you also return data from the mutation query

Source

pub fn query_with_statistics<T: FromTable>( &self, query: &str, ) -> Result<(T, Statistics), Box<dyn Error>>

The same as query, but returns statistics from the query like execution time and nodes/relations affected, etc.

Source

pub fn mutate(&mut self, query: &str) -> Result<(), Box<dyn Error>>

Executes the given query without returning any values

If you want to mutate the graph and retrieve values using one query, use query instead.

Source

pub fn mutate_with_statistics( &mut self, query: &str, ) -> Result<Statistics, Box<dyn Error>>

Same as mutate, but returns statistics about the query.

Source

pub fn delete(self) -> Result<(), Box<dyn Error>>

Deletes the entire graph from the database.

This is a potentially very destructive function. Use with care.

Source

pub fn name(&self) -> &str

Returns the name of the graph

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.