MgpValue

Struct MgpValue 

Source
pub struct MgpValue { /* private fields */ }
Expand description

Useful to own mgp_value coming from / going into Memgraph as a result.

Underlying pointer object is going to be automatically deleted.

NOTE: Implementing From for MgpValue is not simple because not all Value objects can contain Memgraph object (primitive types).

Implementations§

Source§

impl MgpValue

Source

pub fn to_value(&self) -> MgpResult<Value>

Source

pub fn make_null(memgraph: &Memgraph) -> MgpResult<MgpValue>

Source

pub fn is_null(&self) -> bool

Source

pub fn make_bool(value: bool, memgraph: &Memgraph) -> MgpResult<MgpValue>

Source

pub fn is_bool(&self) -> bool

Source

pub fn make_int(value: i64, memgraph: &Memgraph) -> MgpResult<MgpValue>

Source

pub fn is_int(&self) -> bool

Source

pub fn make_double(value: f64, memgraph: &Memgraph) -> MgpResult<MgpValue>

Source

pub fn is_double(&self) -> bool

Source

pub fn make_string(value: &CStr, memgraph: &Memgraph) -> MgpResult<MgpValue>

Source

pub fn is_string(&self) -> bool

Source

pub fn make_list(list: &List, memgraph: &Memgraph) -> MgpResult<MgpValue>

Makes a copy of the given object returning the MgpValue object. MgpValue objects owns the new object.

Source

pub fn is_list(&self) -> bool

Source

pub fn make_map(map: &Map, memgraph: &Memgraph) -> MgpResult<MgpValue>

Makes a copy of the given object returning the MgpValue object. MgpValue objects owns the new object.

Source

pub fn is_map(&self) -> bool

Source

pub fn make_vertex(vertex: &Vertex, memgraph: &Memgraph) -> MgpResult<MgpValue>

Makes a copy of the given object returning the MgpValue object. MgpValue objects owns the new object.

Source

pub fn is_vertex(&self) -> bool

Source

pub fn make_edge(edge: &Edge, memgraph: &Memgraph) -> MgpResult<MgpValue>

Makes a copy of the given object returning the MgpValue object. MgpValue objects owns the new object.

Source

pub fn is_edge(&self) -> bool

Source

pub fn make_path(path: &Path, memgraph: &Memgraph) -> MgpResult<MgpValue>

Makes a copy of the given object returning the MgpValue object. MgpValue objects owns the new object.

Source

pub fn is_path(&self) -> bool

Trait Implementations§

Source§

impl Drop for MgpValue

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl From<MgpValue> for Value

Source§

fn from(item: MgpValue) -> Self

Converts to this type from the input type.

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.