pub struct BcsCodec;Expand description
A StateCodec that uses bcs for all keys and values.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for BcsCodec
impl<'de> Deserialize<'de> for BcsCodec
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 StateCodec for BcsCodec
impl StateCodec for BcsCodec
Source§type KeyCodec = BcsCodec
type KeyCodec = BcsCodec
The codec used to serialize keys. See
StateKeyCodec.Source§type ValueCodec = BcsCodec
type ValueCodec = BcsCodec
The codec used to serialize and deserialize values. See
StateValueCodec.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 BcsCodecwhere
K: Serialize,
impl<K> StateKeyCodec<K> for BcsCodecwhere
K: Serialize,
Source§impl<V> StateValueCodec<V> for BcsCodecwhere
V: Serialize + for<'a> Deserialize<'a>,
impl<V> StateValueCodec<V> for BcsCodecwhere
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 BcsCodec
impl StructuralPartialEq for BcsCodec
Auto Trait Implementations§
impl Freeze for BcsCodec
impl RefUnwindSafe for BcsCodec
impl Send for BcsCodec
impl Sync for BcsCodec
impl Unpin for BcsCodec
impl UnwindSafe for BcsCodec
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<C, T> EncodeKeyLike<T, T> for Cwhere
C: StateKeyCodec<T>,
impl<C, T> EncodeKeyLike<T, T> for Cwhere
C: StateKeyCodec<T>,
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