pub struct JsonCodec;Expand description
JSON codec backed by serde_json.
Trait Implementations§
Source§impl Codec for JsonCodec
impl Codec for JsonCodec
type Error = Error
Source§fn serialize<T>(&self, value: &T) -> Result<Vec<u8>, Self::Error>where
T: Serialize,
fn serialize<T>(&self, value: &T) -> Result<Vec<u8>, Self::Error>where
T: Serialize,
Serialize a value for persistence. Read more
Source§fn deserialize<T>(&self, data: &[u8]) -> Result<T, Self::Error>where
T: DeserializeOwned,
fn deserialize<T>(&self, data: &[u8]) -> Result<T, Self::Error>where
T: DeserializeOwned,
Deserialize a value from stored bytes. Read more
impl Copy for JsonCodec
Auto Trait Implementations§
impl Freeze for JsonCodec
impl RefUnwindSafe for JsonCodec
impl Send for JsonCodec
impl Sync for JsonCodec
impl Unpin for JsonCodec
impl UnwindSafe for JsonCodec
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)