NodeEntity

Trait NodeEntity 

Source
pub trait NodeEntity: FieldSet + TryFrom<Node> {
    type Id: NodeId<T = Self>;

    // Required method
    fn identifier(&self) -> Self::Id;

    // Provided methods
    fn into_identifier(self) -> Self::Id { ... }
    fn create(&self) -> Query { ... }
    fn update(&self) -> Query { ... }
}
Expand description

A node [Entity].

Required Associated Types§

Source

type Id: NodeId<T = Self>

Required Methods§

Source

fn identifier(&self) -> Self::Id

Get the NodeId for this entity.

This is less efficient than using self.into(), but is useful when you don’t want to consume the entity.

The implementation in derive will clone the individual ID fields as necessary.

Provided Methods§

Source

fn into_identifier(self) -> Self::Id

Convenience method for self.into().

Source

fn create(&self) -> Query

Source

fn update(&self) -> Query

Treats the current values as the desired values and does a merge update (SET n += ...).

NOTE: Does not support changing the identifier fields.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§