pub struct SerdeJsonUtils;Implementations§
Source§impl SerdeJsonUtils
impl SerdeJsonUtils
Sourcepub fn from_json_bytes<T>(bytes: &[u8]) -> RocketMQResult<T>where
T: DeserializeOwned,
pub fn from_json_bytes<T>(bytes: &[u8]) -> RocketMQResult<T>where
T: DeserializeOwned,
Deserialize JSON from bytes into a Rust type.
Alias for from_json_slice for backward compatibility.
Sourcepub fn decode<T>(bytes: &[u8]) -> RocketMQResult<T>where
T: DeserializeOwned,
👎Deprecated since 0.7.0: Use from_json_bytes or from_json_slice instead
pub fn decode<T>(bytes: &[u8]) -> RocketMQResult<T>where
T: DeserializeOwned,
from_json_bytes or from_json_slice insteadDeserialize JSON from bytes into a Rust type.
Sourcepub fn from_json_str<T>(json: &str) -> RocketMQResult<T>where
T: DeserializeOwned,
pub fn from_json_str<T>(json: &str) -> RocketMQResult<T>where
T: DeserializeOwned,
Deserialize JSON from a string into a Rust type.
Sourcepub fn from_json_slice<T>(json: &[u8]) -> RocketMQResult<T>where
T: DeserializeOwned,
pub fn from_json_slice<T>(json: &[u8]) -> RocketMQResult<T>where
T: DeserializeOwned,
Deserialize JSON from a byte slice into a Rust type.
Sourcepub fn serialize_json<T>(value: &T) -> RocketMQResult<String>where
T: Serialize,
pub fn serialize_json<T>(value: &T) -> RocketMQResult<String>where
T: Serialize,
Serialize a Rust type into a JSON string (compact format).
Sourcepub fn serialize_json_pretty<T>(value: &T) -> RocketMQResult<String>where
T: Serialize,
pub fn serialize_json_pretty<T>(value: &T) -> RocketMQResult<String>where
T: Serialize,
Serialize a Rust type into a JSON string (pretty-printed format).
Sourcepub fn serialize_json_vec<T>(value: &T) -> RocketMQResult<Vec<u8>>where
T: Serialize,
pub fn serialize_json_vec<T>(value: &T) -> RocketMQResult<Vec<u8>>where
T: Serialize,
Serialize a Rust type into a JSON byte vector (compact format).
Sourcepub fn serialize_json_vec_pretty<T>(value: &T) -> RocketMQResult<Vec<u8>>where
T: Serialize,
pub fn serialize_json_vec_pretty<T>(value: &T) -> RocketMQResult<Vec<u8>>where
T: Serialize,
Serialize a Rust type into a JSON byte vector (pretty-printed format).
Auto Trait Implementations§
impl Freeze for SerdeJsonUtils
impl RefUnwindSafe for SerdeJsonUtils
impl Send for SerdeJsonUtils
impl Sync for SerdeJsonUtils
impl Unpin for SerdeJsonUtils
impl UnwindSafe for SerdeJsonUtils
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