Skip to main content

EntityRoot

Struct EntityRoot 

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

Implementations§

Source§

impl EntityRoot

Source

pub fn push_change_set(&self)

Source

pub fn pop_change_set(&self) -> Option<EntityChangeSet>

Source

pub fn clear_current_change_set(&self)

Source

pub fn set( &self, key: EntityKey, field: impl Into<String>, value: impl Into<Value>, )

Source

pub fn get(&self, key: &EntityKey, field: &str) -> Option<Value>

Source

pub fn current_change_set(&self) -> EntityChangeSet

Source

pub fn set_comment(&self, comment: impl Into<String>)

Set an annotation comment on this entity root. The comment propagates through the graph save process for observability.

Source

pub fn get_comment(&self) -> Option<String>

Get the annotation comment, if any.

Source

pub fn mark_as_new(&self)

Mark this entity root as a newly created entity in memory.

Source

pub fn is_new(&self) -> bool

Check if this entity root is marked as newly created.

Source

pub fn set_original_record(&self, record: Record)

Store the original record when loaded from DB.

Source

pub fn original_record(&self) -> Option<Record>

Retrieve the original record.

Source

pub fn mark_as_delete(&self, key: EntityKey)

Mark an entity as deleted. The next save() call will treat this entity as a Remove operation in the graph save pipeline. Any pending field changes for this entity are cleared — they are irrelevant when the entity is being deleted.

Source

pub fn is_marked_as_delete(&self, key: &EntityKey) -> bool

Check whether an entity has been marked for deletion.

Source

pub fn changed_field_names(&self, key: &EntityKey) -> BTreeSet<String>

Get the set of field names that have been modified for the given entity key. This is the Rust equivalent of Java’s entity.getUpdatedProperties().

Trait Implementations§

Source§

impl Clone for EntityRoot

Source§

fn clone(&self) -> EntityRoot

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EntityRoot

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for EntityRoot

Source§

fn default() -> EntityRoot

Returns the “default value” for a type. Read more
Source§

impl PartialEq for EntityRoot

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.