pub struct JsonSerializer { /* private fields */ }Expand description
Default JSON serializer | 默认 JSON 序列化器
Implementations§
Source§impl JsonSerializer
impl JsonSerializer
Sourcepub fn with_config(config: JsonSerializerConfig) -> JsonSerializer
pub fn with_config(config: JsonSerializerConfig) -> JsonSerializer
Create with custom config (A2-4) | 使用自定义配置创建(A2-4)
Trait Implementations§
Source§impl Clone for JsonSerializer
impl Clone for JsonSerializer
Source§fn clone(&self) -> JsonSerializer
fn clone(&self) -> JsonSerializer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for JsonSerializer
Source§impl Debug for JsonSerializer
impl Debug for JsonSerializer
Source§impl Default for JsonSerializer
impl Default for JsonSerializer
Source§fn default() -> JsonSerializer
fn default() -> JsonSerializer
Returns the “default value” for a type. Read more
Source§fn from(value: JsonSerializer) -> SharedSerializer
fn from(value: JsonSerializer) -> SharedSerializer
Converts to this type from the input type.
Source§impl SaSerializer for JsonSerializer
impl SaSerializer for JsonSerializer
Source§fn kind(&self, raw: &str) -> ValueKind
fn kind(&self, raw: &str) -> ValueKind
Detect payload format for rolling upgrades | 探测 payload 格式以支持滚动升级
Source§fn encode<T>(&self, value: &T) -> Result<String, SerializerError>
fn encode<T>(&self, value: &T) -> Result<String, SerializerError>
Encode domain object to storage string | 编码领域对象为存储字符串 Read more
Source§fn decode<T>(&self, raw: &str) -> Result<T, SerializerError>where
T: DeserializeOwned,
fn decode<T>(&self, raw: &str) -> Result<T, SerializerError>where
T: DeserializeOwned,
Decode storage string to domain object | 解码存储字符串为领域对象 Read more
Source§fn encode_bytes<T>(&self, value: &T) -> Result<Vec<u8>, SerializerError>
fn encode_bytes<T>(&self, value: &T) -> Result<Vec<u8>, SerializerError>
Encode to bytes (default: UTF-8 of
encode) | 编码为 bytes(默认委托 encode)Source§fn decode_bytes<T>(&self, bytes: &[u8]) -> Result<T, SerializerError>where
T: DeserializeOwned,
fn decode_bytes<T>(&self, bytes: &[u8]) -> Result<T, SerializerError>where
T: DeserializeOwned,
Decode from bytes (default: UTF-8 then
decode) | 从 bytes 解码(默认 UTF-8 再 decode)Auto Trait Implementations§
impl Freeze for JsonSerializer
impl RefUnwindSafe for JsonSerializer
impl Send for JsonSerializer
impl Sync for JsonSerializer
impl Unpin for JsonSerializer
impl UnsafeUnpin for JsonSerializer
impl UnwindSafe for JsonSerializer
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> 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