Skip to main content

EntityGraphBuilder

Struct EntityGraphBuilder 

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

Builder for constructing an annotated entity graph that preserves comment trace chains through the save pipeline.

§Example

let graph = EntityGraph::new(task)
    .comment("Create task 'Deploy v2'")
    .child("task_execution_log_list",
        EntityGraph::new(log)
            .comment("Create task 'Deploy v2'"))
    .build();

Implementations§

Source§

impl EntityGraphBuilder

Source

pub fn comment(self, comment: impl Into<String>) -> Self

Set a business-intent comment on this node. The comment will appear in SQL debug logs and audit trails as part of the hierarchical trace chain.

Source

pub fn delete(self) -> Self

Mark this node for deletion instead of save.

Source

pub fn child( self, relation: impl Into<String>, child: EntityGraphBuilder, ) -> Self

Attach a child entity under the given relation name.

Source

pub fn build(self) -> EntityGraph

Finalize and produce the EntityGraph.

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.