pub struct JsonCodec;Expand description
A StateValueCodec that uses serde_json for all values.
Trait Implementations§
source§impl<'de> Deserialize<'de> for JsonCodec
impl<'de> Deserialize<'de> for JsonCodec
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq<JsonCodec> for JsonCodec
impl PartialEq<JsonCodec> for JsonCodec
source§impl StateCodec for JsonCodec
impl StateCodec for JsonCodec
§type ValueCodec = JsonCodec
type ValueCodec = JsonCodec
The codec used to serialize and deserialize values
source§fn value_codec(&self) -> &Self::ValueCodec
fn value_codec(&self) -> &Self::ValueCodec
Returns a reference to the type’s value codec
source§impl<K> StateKeyCodec<K> for JsonCodecwhere
K: Serialize,
impl<K> StateKeyCodec<K> for JsonCodecwhere K: Serialize,
source§impl<V> StateValueCodec<V> for JsonCodecwhere
V: Serialize + for<'a> Deserialize<'a>,
impl<V> StateValueCodec<V> for JsonCodecwhere V: Serialize + for<'a> Deserialize<'a>,
source§fn encode_value(&self, value: &V) -> Vec<u8>
fn encode_value(&self, value: &V) -> Vec<u8>
Serializes a value into a bytes vector. Read more
source§fn try_decode_value(&self, bytes: &[u8]) -> Result<V, Self::Error>
fn try_decode_value(&self, bytes: &[u8]) -> Result<V, Self::Error>
Tries to deserialize a value from a bytes slice, and returns a
Result with either the deserialized value or an error.source§fn decode_value_unwrap(&self, bytes: &[u8]) -> V
fn decode_value_unwrap(&self, bytes: &[u8]) -> V
Deserializes a value from a bytes slice. Read more
impl Eq for JsonCodec
impl StructuralEq for JsonCodec
impl StructuralPartialEq for JsonCodec
Auto Trait Implementations§
impl RefUnwindSafe for JsonCodec
impl Send for JsonCodec
impl Sync for JsonCodec
impl Unpin for JsonCodec
impl UnwindSafe for JsonCodec
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