Struct butane_core::ObjectState
source · pub struct ObjectState {
pub saved: bool,
}
Expand description
Used internally by butane to track state about the object.
Includes information such as whether it has actually been created
in the database yet. Butane automatically creates the field
state: ObjectState
on #[model]
structs. When initializing the
state field, use ObjectState::default()
.
Fields§
§saved: bool
Trait Implementations§
source§impl Clone for ObjectState
impl Clone for ObjectState
source§fn clone(&self) -> ObjectState
fn clone(&self) -> ObjectState
Returns a copy 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 Debug for ObjectState
impl Debug for ObjectState
source§impl Default for ObjectState
impl Default for ObjectState
source§fn default() -> ObjectState
fn default() -> ObjectState
Returns the “default value” for a type. Read more
source§impl PartialEq<ObjectState> for ObjectState
impl PartialEq<ObjectState> for ObjectState
Two ObjectState
s always compare as equal. This effectively
removes ObjectState
from participating in equality tests between
two objects
source§fn eq(&self, _other: &ObjectState) -> bool
fn eq(&self, _other: &ObjectState) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for ObjectState
Auto Trait Implementations§
impl RefUnwindSafe for ObjectState
impl Send for ObjectState
impl Sync for ObjectState
impl Unpin for ObjectState
impl UnwindSafe for ObjectState
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