pub struct Mutation { /* private fields */ }Expand description
A mutation type for models.
Implementations§
Source§impl Mutation
impl Mutation
Sourcepub fn from_entry(key: impl Into<String>, value: impl Into<JsonValue>) -> Self
pub fn from_entry(key: impl Into<String>, value: impl Into<JsonValue>) -> Self
Creates a new instance with the entry.
Sourcepub fn read_map(&mut self, data: &Map) -> Validation
pub fn read_map(&mut self, data: &Map) -> Validation
Updates the mutation using the json object and returns the validation result.
Sourcepub fn allow_fields(&mut self, fields: &[&str])
pub fn allow_fields(&mut self, fields: &[&str])
Retains the editable fields in the allow list. If the editable fields are empty, it will be set to the list.
Sourcepub fn deny_fields(&mut self, fields: &[&str])
pub fn deny_fields(&mut self, fields: &[&str])
Removes the editable fields in the deny list.
Sourcepub fn add_update(
&mut self,
key: impl Into<String>,
value: impl Into<JsonValue>,
)
pub fn add_update( &mut self, key: impl Into<String>, value: impl Into<JsonValue>, )
Adds a key-value pair to the mutation updates.
Sourcepub fn append_updates(&mut self, updates: &mut Map)
pub fn append_updates(&mut self, updates: &mut Map)
Moves all elements from the updates into self.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Mutation
impl RefUnwindSafe for Mutation
impl Send for Mutation
impl Sync for Mutation
impl Unpin for Mutation
impl UnwindSafe for Mutation
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: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more