pub struct Mutation {
pub key: Vec<i64>,
pub value: Vec<i64>,
}
Expand description
A mutation to a single Key
in state.
Fields§
§key: Vec<i64>
Key to data.
value: Vec<i64>
The new value.
Empty value means the value is being deleted.
Implementations§
Source§impl Mutation
impl Mutation
Sourcepub fn encode_size(&self) -> usize
pub fn encode_size(&self) -> usize
Get the size in words of this mutation encoded.
Sourcepub fn encode(&self) -> impl Iterator<Item = i64> + use<'_>
pub fn encode(&self) -> impl Iterator<Item = i64> + use<'_>
Encodes a mutation into a sequence of words.
§Layout
+-----------------+-----------------+
| key length | key |
+-----------------+-----------------+
| value length | value |
+-----------------+-----------------+
Sourcepub fn decode_mutation(bytes: &[i64]) -> Result<Mutation, MutationDecodeError>
pub fn decode_mutation(bytes: &[i64]) -> Result<Mutation, MutationDecodeError>
Decode a mutation from words.
§Layout
+-----------------+-----------------+
| key length | key |
+-----------------+-----------------+
| value length | value |
+-----------------+-----------------+
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Mutation
impl<'de> Deserialize<'de> for Mutation
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Mutation, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Mutation, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for Mutation
impl Ord for Mutation
Source§impl PartialOrd for Mutation
impl PartialOrd for Mutation
Source§impl Serialize for Mutation
impl Serialize for Mutation
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for Mutation
impl StructuralPartialEq for Mutation
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> 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