pub struct ForySerializer { /* private fields */ }Expand description
fory binary serializer (feature fory) | fory 二进制序列化器
Implementations§
Source§impl ForySerializer
impl ForySerializer
Sourcepub fn with_config(config: ForySerializerConfig) -> ForySerializer
pub fn with_config(config: ForySerializerConfig) -> ForySerializer
Create with custom config | 使用自定义配置创建
Trait Implementations§
Source§impl Clone for ForySerializer
impl Clone for ForySerializer
Source§fn clone(&self) -> ForySerializer
fn clone(&self) -> ForySerializer
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 ForySerializer
Source§impl Debug for ForySerializer
impl Debug for ForySerializer
Source§impl Default for ForySerializer
impl Default for ForySerializer
Source§fn default() -> ForySerializer
fn default() -> ForySerializer
Returns the “default value” for a type. Read more
Source§fn from(value: ForySerializer) -> SharedSerializer
fn from(value: ForySerializer) -> SharedSerializer
Converts to this type from the input type.
Source§impl SaSerializer for ForySerializer
impl SaSerializer for ForySerializer
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 ForySerializer
impl RefUnwindSafe for ForySerializer
impl Send for ForySerializer
impl Sync for ForySerializer
impl Unpin for ForySerializer
impl UnsafeUnpin for ForySerializer
impl UnwindSafe for ForySerializer
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