pub struct TrackedModel<T> { /* private fields */ }Expand description
A model instance with explicit “fields set” tracking.
Implementations§
Source§impl<T> TrackedModel<T>
impl<T> TrackedModel<T>
Sourcepub const fn new(inner: T, fields_set: FieldsSet) -> TrackedModel<T>
pub const fn new(inner: T, fields_set: FieldsSet) -> TrackedModel<T>
Wrap an instance and an explicit FieldsSet.
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Consume and return the wrapped instance.
Sourcepub const fn fields_set(&self) -> &FieldsSet
pub const fn fields_set(&self) -> &FieldsSet
Access the explicit fields-set bitset.
Source§impl<T> TrackedModel<T>where
T: Model,
impl<T> TrackedModel<T>where
T: Model,
Sourcepub fn all_fields_set(inner: T) -> TrackedModel<T>
pub fn all_fields_set(inner: T) -> TrackedModel<T>
Wrap an instance and mark all model fields as set.
Sourcepub fn from_explicit_field_names(inner: T, names: &[&str]) -> TrackedModel<T>
pub fn from_explicit_field_names(inner: T, names: &[&str]) -> TrackedModel<T>
Wrap an instance, marking only the provided field names as “set”.
Field names must match FieldInfo.name values (post-alias).
Source§impl<T> TrackedModel<T>
impl<T> TrackedModel<T>
Sourcepub fn sql_model_dump(&self, options: DumpOptions) -> Result<Value, Error>
pub fn sql_model_dump(&self, options: DumpOptions) -> Result<Value, Error>
Model-aware dump with correct exclude_unset semantics.
This mirrors SqlModelDump::sql_model_dump, but supports exclude_unset
by consulting the stored FieldsSet.
pub fn sql_model_dump_json(&self) -> Result<String, Error>
pub fn sql_model_dump_json_pretty(&self) -> Result<String, Error>
pub fn sql_model_dump_json_with_options( &self, options: DumpOptions, ) -> Result<String, Error>
Trait Implementations§
Source§impl<T> Clone for TrackedModel<T>where
T: Clone,
impl<T> Clone for TrackedModel<T>where
T: Clone,
Source§fn clone(&self) -> TrackedModel<T>
fn clone(&self) -> TrackedModel<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T> Debug for TrackedModel<T>where
T: Debug,
impl<T> Debug for TrackedModel<T>where
T: Debug,
Source§impl<T> Deref for TrackedModel<T>
impl<T> Deref for TrackedModel<T>
Source§impl<T> DerefMut for TrackedModel<T>
impl<T> DerefMut for TrackedModel<T>
Auto Trait Implementations§
impl<T> Freeze for TrackedModel<T>where
T: Freeze,
impl<T> RefUnwindSafe for TrackedModel<T>where
T: RefUnwindSafe,
impl<T> Send for TrackedModel<T>where
T: Send,
impl<T> Sync for TrackedModel<T>where
T: Sync,
impl<T> Unpin for TrackedModel<T>where
T: Unpin,
impl<T> UnwindSafe for TrackedModel<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).