pub enum StackValue {
Integer(i64),
Float(f64),
String(String),
Bool(bool),
}
Variants§
Implementations§
Source§impl StackValue
impl StackValue
pub fn loose_equal(&self, other: &Self) -> bool
pub fn strict_equal(&self, other: &Self) -> bool
Trait Implementations§
Source§impl Add for StackValue
impl Add for StackValue
Source§impl BitAnd for StackValue
impl BitAnd for StackValue
Source§impl BitOr for StackValue
impl BitOr for StackValue
Source§impl BitXor for StackValue
impl BitXor for StackValue
Source§impl Clone for StackValue
impl Clone for StackValue
Source§fn clone(&self) -> StackValue
fn clone(&self) -> StackValue
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 Debug for StackValue
impl Debug for StackValue
Source§impl Deserialize for StackValue
impl Deserialize for StackValue
Source§fn deserialize(
deserializer: &mut Deserializer<'_, impl Read>,
) -> Result<Self, SavefileError>
fn deserialize( deserializer: &mut Deserializer<'_, impl Read>, ) -> Result<Self, SavefileError>
Deserialize and return an instance of Self from the given deserializer.
Source§impl Display for StackValue
impl Display for StackValue
Source§impl Div for StackValue
impl Div for StackValue
Source§impl Introspect for StackValue
impl Introspect for StackValue
Source§fn introspect_value(&self) -> String
fn introspect_value(&self) -> String
Returns the value of the object, excluding children, as a string.
Exactly what the value returned here is depends on the type.
For some types, like a plain array, there isn’t much of a value,
the entire information of object resides in the children.
For other cases, like a department in an organisation, it might
make sense to have the value be the name, and have all the other properties
as children.
Source§fn introspect_child(
&self,
index: usize,
) -> Option<Box<dyn IntrospectItem<'_> + '_>>
fn introspect_child( &self, index: usize, ) -> Option<Box<dyn IntrospectItem<'_> + '_>>
Returns an the name and &dyn Introspect for the child with the given index,
or if no child with that index exists, None.
All the children should be indexed consecutively starting at 0 with no gaps,
all though there isn’t really anything stopping the user of the trait to have
any arbitrary index strategy, consecutive numbering 0, 1, 2, … etc is strongly
encouraged.
Source§fn introspect_len(&self) -> usize
fn introspect_len(&self) -> usize
Returns the total number of children.
The default implementation calculates this by simply calling introspect_child with
higher and higher indexes until it returns None.
It gives up if the count reaches 10000. If your type can be bigger
and you want to be able to introspect it, override this method.
Source§impl Mul for StackValue
impl Mul for StackValue
Source§impl Not for StackValue
impl Not for StackValue
Source§impl Packed for StackValue
impl Packed for StackValue
Source§unsafe fn repr_c_optimization_safe(file_version: u32) -> IsPacked
unsafe fn repr_c_optimization_safe(file_version: u32) -> IsPacked
This method returns true if the optimization is allowed
for the protocol version given as an argument.
This may return true if and only if the given protocol version
has a serialized format identical to the memory layout of the given protocol version.
Note, the only memory layout existing is that of the most recent version, so
Packed-optimization only works when disk-format is identical to memory version. Read more
Source§impl PartialEq for StackValue
impl PartialEq for StackValue
Source§impl PartialOrd for StackValue
impl PartialOrd for StackValue
Source§impl Serialize for StackValue
impl Serialize for StackValue
Source§fn serialize(
&self,
serializer: &mut Serializer<'_, impl Write>,
) -> Result<(), SavefileError>
fn serialize( &self, serializer: &mut Serializer<'_, impl Write>, ) -> Result<(), SavefileError>
Serialize self into the given serializer. Read more
Source§impl Shl for StackValue
impl Shl for StackValue
Source§impl Shr for StackValue
impl Shr for StackValue
Source§impl Sub for StackValue
impl Sub for StackValue
Source§impl WithSchema for StackValue
impl WithSchema for StackValue
impl StructuralPartialEq for StackValue
Auto Trait Implementations§
impl Freeze for StackValue
impl RefUnwindSafe for StackValue
impl Send for StackValue
impl Sync for StackValue
impl Unpin for StackValue
impl UnwindSafe for StackValue
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> 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