pub trait Serializer: 'static {
Show 20 methods
// Required methods
fn fory_write_data(
&self,
context: &mut WriteContext<'_>,
) -> Result<(), Error>;
fn fory_read_data(context: &mut ReadContext<'_>) -> Result<Self, Error>
where Self: Sized + ForyDefault;
fn fory_type_id_dyn(
&self,
type_resolver: &TypeResolver,
) -> Result<TypeId, Error>;
fn as_any(&self) -> &(dyn Any + 'static);
// Provided methods
fn fory_write(
&self,
context: &mut WriteContext<'_>,
ref_mode: RefMode,
write_type_info: bool,
has_generics: bool,
) -> Result<(), Error>
where Self: Sized { ... }
fn fory_write_data_generic(
&self,
context: &mut WriteContext<'_>,
has_generics: bool,
) -> Result<(), Error> { ... }
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
where Self: Sized { ... }
fn fory_read(
context: &mut ReadContext<'_>,
ref_mode: RefMode,
read_type_info: bool,
) -> Result<Self, Error>
where Self: Sized + ForyDefault { ... }
fn fory_read_with_type_info(
context: &mut ReadContext<'_>,
ref_mode: RefMode,
type_info: Rc<TypeInfo>,
) -> Result<Self, Error>
where Self: Sized + ForyDefault { ... }
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
where Self: Sized { ... }
fn fory_is_option() -> bool
where Self: Sized { ... }
fn fory_is_none(&self) -> bool { ... }
fn fory_is_polymorphic() -> bool
where Self: Sized { ... }
fn fory_is_shared_ref() -> bool
where Self: Sized { ... }
fn fory_is_wrapper_type() -> bool
where Self: Sized { ... }
fn fory_static_type_id() -> TypeId
where Self: Sized { ... }
fn fory_get_type_id(type_resolver: &TypeResolver) -> Result<TypeId, Error>
where Self: Sized { ... }
fn fory_get_type_info(
type_resolver: &TypeResolver,
) -> Result<Rc<TypeInfo>, Error>
where Self: Sized { ... }
fn fory_concrete_type_id(&self) -> TypeId { ... }
fn fory_reserved_space() -> usize
where Self: Sized { ... }
}Expand description
Core trait for Fory serialization and deserialization.
Serializer is the primary trait that enables types to be serialized and deserialized
using Fory’s high-performance cross-language protocol. All types that can be serialized
with Fory must implement this trait, either manually or via the #[derive(ForyObject)] macro.
§Architecture Overview
Fory’s serialization consists of three main phases:
- Reference tracking (optional): Writes/reads null/not-null/ref flags for handling shared references and circular references
- Type information (optional): Writes/reads type metadata for polymorphic types
- Data serialization: Writes/reads the actual data payload
§Method Categories
§Methods Users Must Implement (for custom serialization logic)
fory_write_data: Core method to serialize your type’s datafory_read_data: Core method to deserialize your type’s datafory_type_id_dyn: Return runtime type ID for the instanceas_any: Downcast support for dynamic dispatch
§Methods Implemented by Fory (override only if needed)
Most methods have default implementations suitable for common types:
fory_write: Entry point for serialization (handles ref/type info)fory_read: Entry point for deserialization (handles ref/type info)fory_write_type_info: Write type metadatafory_read_type_info: Read type metadatafory_write_data_generic: Write data with generics support (for collections)fory_read_with_type_info: Deserialize with pre-read type info
§Type Query Methods
These provide compile-time and runtime type information:
fory_static_type_id: Static type ID (defaults to TypeId::EXT for user types)fory_get_type_id: Get registered type ID from TypeResolverfory_concrete_type_id: Get Rust’s std::any::TypeIdfory_is_option: Check if type isOption<T>fory_is_none: Check if instance is None (for Option types)fory_is_polymorphic: Check if type supports polymorphismfory_is_shared_ref: Check if type is Rc/Arcfory_reserved_space: Hint for buffer pre-allocation
§Typical Usage Pattern
For types that need custom serialization logic (EXT types), you only need to implement four methods:
impl Serializer for MyType {
fn fory_write_data(&self, context: &mut WriteContext) -> Result<(), Error> {
// Write your type's fields
}
fn fory_read_data(context: &mut ReadContext) -> Result<Self, Error> {
// Read your type's fields
}
fn fory_type_id_dyn(&self, type_resolver: &TypeResolver) -> Result<fory_core::TypeId, Error> {
Self::fory_get_type_id(type_resolver)
}
fn as_any(&self) -> &dyn Any {
self
}
}§Derive Macro
For struct types, you can use the #[derive(ForyObject)] macro instead of implementing manually:
#[derive(ForyObject)]
struct Point {
x: f64,
y: f64,
}§See Also
ForyDefault: Trait for creating default values during deserializationStructSerializer: Extended trait for struct-specific serialization
Required Methods§
Sourcefn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
[USER IMPLEMENTATION REQUIRED] Serialize the type’s data to the buffer.
This is the core serialization method that you must implement for custom types. It should write all the type’s fields and data to the buffer using the provided context.
§Parameters
context- Write context providing:context.writer: Buffer to write binary datacontext.type_resolver: Registry of type informationcontext.ref_resolver: Resolver for shared/circular references (if enabled)
§Writing Data
Use methods on context.writer to write primitive types:
write_i8(),write_i16(),write_i32(),write_i64(): Signed integerswrite_u8(),write_u16(),write_u32(),write_u64(): Unsigned integerswrite_f32(),write_f64(): Floating point numberswrite_bool(): Boolean valueswrite_bytes(): Raw byte arrays
For nested types that implement Serializer, call their serialization:
// For types that implement Serializer
self.nested_field.fory_write(context, false, false, false)?;§Examples
§Simple struct with primitive fields
use fory_core::{Serializer, ForyDefault};
use fory_core::resolver::context::WriteContext;
use fory_core::error::Error;
use std::any::Any;
struct Point {
x: f64,
y: f64,
}
impl ForyDefault for Point {
fn fory_default() -> Self {
Point { x: 0.0, y: 0.0 }
}
}
impl Serializer for Point {
fn fory_write_data(&self, context: &mut WriteContext) -> Result<(), Error> {
// Write each field in order
context.writer.write_f64(self.x);
context.writer.write_f64(self.y);
Ok(())
}
fn fory_read_data(context: &mut fory_core::resolver::context::ReadContext) -> Result<Self, Error>
where
Self: Sized + fory_core::ForyDefault,
{
let x = context.reader.read_f64()?;
let y = context.reader.read_f64()?;
Ok(Point { x, y })
}
fn fory_type_id_dyn(&self, type_resolver: &fory_core::TypeResolver) -> Result<fory_core::TypeId, Error> {
Self::fory_get_type_id(type_resolver)
}
fn as_any(&self) -> &dyn Any {
self
}
}§Struct with nested serializable types
use fory_core::{Serializer, ForyDefault, RefMode};
use fory_core::resolver::context::WriteContext;
use fory_core::error::Error;
use std::any::Any;
struct Person {
name: String,
age: u32,
scores: Vec<i32>,
}
impl ForyDefault for Person {
fn fory_default() -> Self {
Person {
name: String::new(),
age: 0,
scores: Vec::new(),
}
}
}
impl Serializer for Person {
fn fory_write_data(&self, context: &mut WriteContext) -> Result<(), Error> {
// Write nested types using their Serializer implementations
self.name.fory_write(context, RefMode::None, false, false)?;
context.writer.write_u32(self.age);
self.scores.fory_write(context, RefMode::None, false, true)?; // has_generics=true for Vec
Ok(())
}
fn fory_read_data(context: &mut fory_core::resolver::context::ReadContext) -> Result<Self, Error>
where
Self: Sized + fory_core::ForyDefault,
{
let name = String::fory_read(context, RefMode::None, false)?;
let age = context.reader.read_u32()?;
let scores = Vec::<i32>::fory_read(context, RefMode::None, false)?;
Ok(Person { name, age, scores })
}
fn fory_type_id_dyn(&self, type_resolver: &fory_core::TypeResolver) -> Result<fory_core::TypeId, Error> {
Self::fory_get_type_id(type_resolver)
}
fn as_any(&self) -> &dyn Any {
self
}
}§Implementation Guidelines
- Field order matters: Write fields in a consistent order; read them in the same order
- No metadata here: Don’t write type info or ref flags; that’s handled by
fory_write - Use Serializer for nested types: Leverage existing implementations for standard types
- Error handling: Propagate errors with
?; don’t swallow them - Performance: Minimize allocations; write directly to the buffer
§Common Patterns
// Writing primitives directly
context.writer.write_i32(self.count);
// Writing nested Serializer types
self.nested.fory_write(context, false, false, false)?;
// Writing collections with generics
self.items.fory_write(context, false, false, true)?;
// Writing optional types
self.optional.fory_write(context, true, false, false)?; // write_ref_info=true§See Also
fory_read_data: Corresponding deserialization methodfory_write: High-level serialization entry pointWriteContext: Context providing buffer and resolver access
Sourcefn fory_read_data(context: &mut ReadContext<'_>) -> Result<Self, Error>where
Self: Sized + ForyDefault,
fn fory_read_data(context: &mut ReadContext<'_>) -> Result<Self, Error>where
Self: Sized + ForyDefault,
[USER IMPLEMENTATION REQUIRED] Deserialize the type’s data from the buffer.
This is the core deserialization method that you must implement for custom types.
It should read all the type’s fields and data from the buffer in the same order
they were written by fory_write_data.
§Parameters
context- Read context providing:context.reader: Buffer to read binary datacontext.type_resolver: Registry of type informationcontext.ref_resolver: Resolver for shared/circular references (if enabled)
§Type Requirements
Requires Self: Sized + ForyDefault:
- Sized: Need to construct concrete instances on the stack
- ForyDefault: Need to create default/null values for optional fields
§Reading Data
Use methods on context.reader to read primitive types:
read_i8(),read_i16(),read_i32(),read_i64(): Signed integersread_u8(),read_u16(),read_u32(),read_u64(): Unsigned integersread_f32(),read_f64(): Floating point numbersread_bool(): Boolean valuesread_bytes(): Raw byte arrays
For nested types that implement Serializer, call their deserialization:
// For types that implement Serializer
let field = T::fory_read(context, false, false)?;§Examples
§Simple struct with primitive fields
use fory_core::{Serializer, ForyDefault};
use fory_core::resolver::context::{ReadContext, WriteContext};
use fory_core::error::Error;
use std::any::Any;
#[derive(Debug, PartialEq)]
struct Point {
x: f64,
y: f64,
}
impl ForyDefault for Point {
fn fory_default() -> Self {
Point { x: 0.0, y: 0.0 }
}
}
impl Serializer for Point {
fn fory_write_data(&self, context: &mut WriteContext) -> Result<(), Error> {
context.writer.write_f64(self.x);
context.writer.write_f64(self.y);
Ok(())
}
fn fory_read_data(context: &mut ReadContext) -> Result<Self, Error>
where
Self: Sized + ForyDefault,
{
// Read fields in the same order as written
let x = context.reader.read_f64()?;
let y = context.reader.read_f64()?;
Ok(Point { x, y })
}
fn fory_type_id_dyn(&self, type_resolver: &fory_core::TypeResolver) -> Result<fory_core::TypeId, Error> {
Self::fory_get_type_id(type_resolver)
}
fn as_any(&self) -> &dyn Any {
self
}
}§Struct with nested serializable types
use fory_core::{Serializer, ForyDefault, RefMode};
use fory_core::resolver::context::{ReadContext, WriteContext};
use fory_core::error::Error;
use std::any::Any;
#[derive(Debug, PartialEq)]
struct Person {
name: String,
age: u32,
scores: Vec<i32>,
}
impl ForyDefault for Person {
fn fory_default() -> Self {
Person {
name: String::new(),
age: 0,
scores: Vec::new(),
}
}
}
impl Serializer for Person {
fn fory_write_data(&self, context: &mut WriteContext) -> Result<(), Error> {
self.name.fory_write(context, RefMode::None, false, false)?;
context.writer.write_u32(self.age);
self.scores.fory_write(context, RefMode::None, false, true)?;
Ok(())
}
fn fory_read_data(context: &mut ReadContext) -> Result<Self, Error>
where
Self: Sized + ForyDefault,
{
// Read nested types in the same order as written
let name = String::fory_read(context, RefMode::None, false)?;
let age = context.reader.read_u32()?;
let scores = Vec::<i32>::fory_read(context, RefMode::None, false)?;
Ok(Person { name, age, scores })
}
fn fory_type_id_dyn(&self, type_resolver: &fory_core::TypeResolver) -> Result<fory_core::TypeId, Error> {
Self::fory_get_type_id(type_resolver)
}
fn as_any(&self) -> &dyn Any {
self
}
}§Struct with optional fields
use fory_core::{Serializer, ForyDefault};
use fory_core::resolver::context::{ReadContext, WriteContext};
use fory_core::error::Error;
use std::any::Any;
#[derive(Debug, PartialEq)]
struct Config {
name: String,
timeout: Option<u32>,
}
impl ForyDefault for Config {
fn fory_default() -> Self {
Config {
name: String::new(),
timeout: None,
}
}
}
impl Serializer for Config {
fn fory_write_data(&self, context: &mut WriteContext) -> Result<(), Error> {
self.name.fory_write(context, false, false, false)?;
// Option needs ref tracking to handle None
self.timeout.fory_write(context, true, false, false)?;
Ok(())
}
fn fory_read_data(context: &mut ReadContext) -> Result<Self, Error>
where
Self: Sized + ForyDefault,
{
let name = String::fory_read(context, false, false)?;
// Read Option with ref tracking enabled
let timeout = Option::<u32>::fory_read(context, true, false)?;
Ok(Config { name, timeout })
}
fn fory_type_id_dyn(&self, type_resolver: &fory_core::TypeResolver) -> Result<fory_core::TypeId, Error> {
Self::fory_get_type_id(type_resolver)
}
fn as_any(&self) -> &dyn Any {
self
}
}§Implementation Guidelines
- Mirror write order: Read fields in the exact same order as
fory_write_datawrites them - Error propagation: Use
?operator to propagate read errors - No metadata reading: Don’t read ref flags or type info; that’s handled by
fory_read - Use Serializer for nested types: Leverage existing implementations
- Handle errors gracefully: Return descriptive errors for invalid data
§Common Patterns
// Reading primitives
let count = context.reader.read_i32()?;
// Reading nested Serializer types
let nested = T::fory_read(context, false, false)?;
// Reading collections
let items = Vec::<T>::fory_read(context, false, false)?;
// Reading optional types
let optional = Option::<T>::fory_read(context, true, false)?;§Error Handling
Return errors for:
- Buffer underflow: Not enough data to read
- Invalid data: Data doesn’t match expected format
- Version mismatch: Incompatible serialization format
if value > MAX_ALLOWED {
return Err(Error::invalid_data(format!("Value {} exceeds maximum", value)));
}§See Also
fory_write_data: Corresponding serialization methodfory_read: High-level deserialization entry pointForyDefault: Trait for creating default valuesReadContext: Context providing buffer and resolver access
Sourcefn fory_type_id_dyn(
&self,
type_resolver: &TypeResolver,
) -> Result<TypeId, Error>
fn fory_type_id_dyn( &self, type_resolver: &TypeResolver, ) -> Result<TypeId, Error>
[USER IMPLEMENTATION REQUIRED] Get the runtime type ID for this instance.
This method returns the type ID for the actual runtime type of the instance, which may differ from the static type for polymorphic types.
§Parameters
type_resolver- The type registry to query
§Returns
The numeric type ID for this instance’s runtime type.
§Implementation Pattern
For most types, simply delegate to fory_get_type_id:
fn fory_type_id_dyn(&self, type_resolver: &TypeResolver) -> Result<fory_core::TypeId, Error> {
Self::fory_get_type_id(type_resolver)
}For polymorphic types, return the actual runtime type:
fn fory_type_id_dyn(&self, type_resolver: &TypeResolver) -> Result<fory_core::TypeId, Error> {
// Get the actual type ID based on runtime type
self.get_actual_type().fory_get_type_id(type_resolver)
}Sourcefn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
[USER IMPLEMENTATION REQUIRED] Downcast to &dyn Any for dynamic type checking.
This method enables runtime type checking and downcasting, required for Fory’s type system integration.
§Returns
A reference to this instance as &dyn Any.
§Implementation Pattern
Always implement this by returning self:
fn as_any(&self) -> &dyn Any {
self
}§Implementation Notes
- Required for all types implementing
Serializer - Enables
downcast_ref::<T>()on serialized values - Used by Fory’s polymorphic deserialization
Provided Methods§
Sourcefn fory_write(
&self,
context: &mut WriteContext<'_>,
ref_mode: RefMode,
write_type_info: bool,
has_generics: bool,
) -> Result<(), Error>where
Self: Sized,
fn fory_write(
&self,
context: &mut WriteContext<'_>,
ref_mode: RefMode,
write_type_info: bool,
has_generics: bool,
) -> Result<(), Error>where
Self: Sized,
Entry point for serialization.
This method orchestrates the complete serialization process, handling reference tracking,
type information, and delegating to fory_write_data for the actual data serialization.
§Parameters
ref_mode- Controls how reference flags are written:RefMode::None: Skip writing ref flag entirelyRefMode::NullOnly: WriteNotNullValueflag (null check only)RefMode::Tracking: Write ref tracking flags (for Rc/Arc/Weak)
write_type_info- Whentrue, WRITES type information. Whenfalse, SKIPS writing type info.has_generics- Indicates if the type has generic parameters (used for collection meta).
§Default Implementation (Fast Path)
The default implementation uses a fast path suitable for primitives, strings, and time types:
- If
ref_mode != RefMode::None, writesRefFlag::NotNullValue - If
write_type_infois true, callsfory_write_type_info - Calls
fory_write_data_genericto write the actual data
§When to Override
You should override this method for:
- Option types: Need to handle
NonewithRefFlag::Null - Reference types (Rc/Arc/Weak): Need full ref tracking with
RefWriter - Polymorphic types: Need to write actual runtime type instead of static type
For regular types (structs, primitives, collections), the default implementation is sufficient.
Sourcefn fory_write_data_generic(
&self,
context: &mut WriteContext<'_>,
has_generics: bool,
) -> Result<(), Error>
fn fory_write_data_generic( &self, context: &mut WriteContext<'_>, has_generics: bool, ) -> Result<(), Error>
Write data with generic type parameter support.
This method is primarily used by collection types (Vec, HashMap, etc.) that need to
write generic type information for their elements. For most types, this simply
delegates to fory_write_data.
§Parameters
context- Write context containing the buffer and type resolverhas_generics- Indicates if the type has generic parameters that need metadata
§Default Implementation
The default implementation ignores has_generics and forwards to fory_write_data:
fn fory_write_data_generic(&self, context: &mut WriteContext, has_generics: bool) -> Result<(), Error> {
self.fory_write_data(context)
}§When to Override
Override this method for:
- Collection types (Vec, HashMap, HashSet, etc.): Need to write element/key/value type metadata
- Generic containers: Any type that contains type parameters requiring runtime metadata
For non-generic types (primitives, simple structs), use the default implementation.
§Implementation Notes
- Implemented by Fory for all collection types
- User types with custom serialization for non-generic types don’t need to override
- Focus on implementing
fory_write_datafor custom types
Sourcefn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>where
Self: Sized,
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>where
Self: Sized,
Write type metadata to the buffer.
This method writes type information that allows Fory to identify and deserialize the type correctly, especially for polymorphic scenarios.
§Default Implementation
The default implementation writes:
- Static type ID from
fory_static_type_id - Rust’s
std::any::TypeIdfor runtime type identification
fn fory_write_type_info(context: &mut WriteContext) -> Result<(), Error> {
let rs_type_id = std::any::TypeId::of::<Self>();
context.write_any_type_info(Self::fory_static_type_id() as u32, rs_type_id)?;
Ok(())
}§When to Override
Override this method for:
- Built-in types: Fory’s internal types override for optimized performance
- Custom type ID schemes: If you need special type identification logic
For user types with custom serialization, the default implementation is typically sufficient.
§Implementation Notes
- Called by
fory_writewhenwrite_type_infois true - Implemented by Fory for all built-in types with optimized paths
- User types with custom serialization rarely need to override this
Sourcefn fory_read(
context: &mut ReadContext<'_>,
ref_mode: RefMode,
read_type_info: bool,
) -> Result<Self, Error>where
Self: Sized + ForyDefault,
fn fory_read(
context: &mut ReadContext<'_>,
ref_mode: RefMode,
read_type_info: bool,
) -> Result<Self, Error>where
Self: Sized + ForyDefault,
Entry point for deserialization.
This method orchestrates the complete deserialization process, handling reference tracking,
type information validation, and delegating to fory_read_data for the actual data deserialization.
§Parameters
ref_mode- Controls how reference flags are read:RefMode::None: Skip reading ref flag entirelyRefMode::NullOnly: Read flag, return default on nullRefMode::Tracking: Full ref tracking (for Rc/Arc/Weak)
read_type_info- Whentrue, READS type information from buffer. Whenfalse, SKIPS reading type info.
§Type Requirements
This method requires Self: Sized + ForyDefault because:
- Sized: Need to construct concrete instances
- ForyDefault: Need to create default/null values for optional types
§Default Implementation (Fast Path)
The default implementation uses a fast path suitable for primitives, strings, and time types:
- If
ref_mode != RefMode::None:- Reads ref flag from buffer
- Returns
ForyDefault::fory_default()for null values
- If
read_type_infois true, callsfory_read_type_info - Calls
fory_read_datato read the actual data
§When to Override
Override this method for:
- Option types: Need custom null handling logic
- Reference types (Rc/Arc/Weak): Need custom ref tracking with RefReader
- Polymorphic types: Need to dispatch based on actual runtime type
For regular types (structs, primitives, collections), the default implementation is sufficient.
Sourcefn fory_read_with_type_info(
context: &mut ReadContext<'_>,
ref_mode: RefMode,
type_info: Rc<TypeInfo>,
) -> Result<Self, Error>where
Self: Sized + ForyDefault,
fn fory_read_with_type_info(
context: &mut ReadContext<'_>,
ref_mode: RefMode,
type_info: Rc<TypeInfo>,
) -> Result<Self, Error>where
Self: Sized + ForyDefault,
Deserialize with pre-read type information.
This method is used when type information has already been read from the buffer and needs to be passed to the deserialization logic. This is common in polymorphic deserialization scenarios where the runtime type differs from the static type.
§Parameters
ref_mode- Controls how reference flags are read (seefory_read)type_info- Type information that has already been read ahead. DO NOT read type info again from buffer.
§Important
DO NOT read type info from the buffer in this method. The type_info parameter
contains the already-read type metadata. Reading it again will cause buffer position errors.
§Default Implementation
The default implementation ignores the provided type_info and delegates to fory_read:
fn fory_read_with_type_info(
context: &mut ReadContext,
ref_mode: RefMode,
type_info: Rc<TypeInfo>,
) -> Result<Self, Error> {
// Ignore type_info since static type matches
Self::fory_read(context, ref_mode, false) // read_type_info=false
}This works for:
- Monomorphic types: Static type matches runtime type
- Final types: Types that don’t participate in polymorphism
- User-defined types: Types registered with Fory that don’t require polymorphism
§When to Override
Override this method for:
- Trait objects (dyn Trait): Need to dispatch to concrete implementation based on type_info
- Reference types with polymorphic targets: Rc<dyn Trait>, Arc<dyn Trait>
- Custom polymorphic types: Types with runtime type variation
Sourcefn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>where
Self: Sized,
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>where
Self: Sized,
Read and validate type metadata from the buffer.
This method reads type information to verify that the data in the buffer
matches the expected type. It’s the counterpart to fory_write_type_info.
§Default Implementation
The default implementation reads and validates the type info:
fn fory_read_type_info(context: &mut ReadContext) -> Result<(), Error> {
context.read_any_type_info()?;
Ok(())
}§When to Override
Override this method for:
- Built-in types: Fory’s internal types override for optimized performance
- Custom validation logic: If you need special type checking
For user types with custom serialization, the default implementation is typically sufficient.
§Implementation Notes
- Called by
fory_readwhenread_type_infois true - Implemented by Fory for all built-in types with optimized paths
- User types with custom serialization rarely need to override this
Sourcefn fory_is_option() -> boolwhere
Self: Sized,
fn fory_is_option() -> boolwhere
Self: Sized,
Sourcefn fory_is_none(&self) -> bool
fn fory_is_none(&self) -> bool
Check if this instance represents a None value.
This method is used for runtime checking of optional values.
§Returns
trueif the instance isOption::Nonefalsefor all other values (default)
§Implementation Notes
- Implemented by Fory for
Option<T>to check None state - User types with custom serialization should not override this
- Used with
fory_is_optionfor null handling
Sourcefn fory_is_polymorphic() -> boolwhere
Self: Sized,
fn fory_is_polymorphic() -> boolwhere
Self: Sized,
Check if this type supports polymorphic serialization.
Polymorphic types can have different runtime types than their static type, requiring special handling during serialization and deserialization.
§Returns
trueif the type is polymorphic (trait objects, dynamic dispatch)falsefor monomorphic types (default)
§Examples of Polymorphic Types
- Trait objects:
Box<dyn Trait>,Rc<dyn Trait>,Arc<dyn Trait>
§Implementation Notes
- Implemented by Fory for all polymorphic types
- User types with custom serialization typically should not override this
- Used to determine if type info must be written
Check if this type is a shared reference (Rc/Arc).
Shared references require special handling for reference tracking to support proper sharing and circular reference detection.
§Returns
trueif the type isRc<T>orArc<T>falsefor all other types (default)
§Implementation Notes
- Implemented by Fory for
Rc<T>andArc<T> - User types with custom serialization should not override this
- Used for reference tracking and deduplication
fn fory_is_wrapper_type() -> boolwhere
Self: Sized,
Sourcefn fory_static_type_id() -> TypeIdwhere
Self: Sized,
fn fory_static_type_id() -> TypeIdwhere
Self: Sized,
Get the static Fory type ID for this type.
Type IDs are Fory’s internal type identification system, separate from
Rust’s std::any::TypeId. They’re used for cross-language serialization
and protocol compatibility.
§Returns
- For built-in types: Specific type ID (e.g.,
TypeId::I32,TypeId::STRING) - For external types:
TypeId::EXT(default)
§Type ID Categories
- Primitives:
BOOL,I8,I16,I32,I64,U8,U16,U32,U64,USIZE,U128,F32,F64 - Strings:
STRING - Collections:
LIST,MAP,SET - Structs:
STRUCT - Enums:
ENUM - User types:
EXTfor user types with custom serialization logic
§Implementation Notes
- Default returns
TypeId::EXTfor user types - Fory implements specific type IDs for all built-in types
- User types with custom serialization should use the default
- This is a compile-time constant
Sourcefn fory_get_type_id(type_resolver: &TypeResolver) -> Result<TypeId, Error>where
Self: Sized,
fn fory_get_type_id(type_resolver: &TypeResolver) -> Result<TypeId, Error>where
Self: Sized,
Get the registered type ID from the type resolver.
This method looks up the type’s assigned ID in the type registry, which is required for serialization of external types.
§Parameters
type_resolver- The type registry to query
§Returns
The numeric type ID assigned to this type during registration.
§Errors
Returns an error if the type is not registered with the resolver.
§Implementation Notes
- Default implementation looks up via
std::any::TypeId - User types must be registered before serialization
- Built-in types have pre-assigned IDs
- This is typically called by
fory_type_id_dyn
fn fory_get_type_info(
type_resolver: &TypeResolver,
) -> Result<Rc<TypeInfo>, Error>where
Self: Sized,
Sourcefn fory_concrete_type_id(&self) -> TypeId
fn fory_concrete_type_id(&self) -> TypeId
Get Rust’s std::any::TypeId for this instance.
Returns the runtime type identifier from Rust’s type system. This is used for type resolution and registration.
§Returns
The std::any::TypeId for this instance’s concrete type.
§Implementation Notes
- Default implementation uses
TypeId::of::<Self>() - User types with custom serialization should not override this
- Used by type resolution infrastructure
Sourcefn fory_reserved_space() -> usizewhere
Self: Sized,
fn fory_reserved_space() -> usizewhere
Self: Sized,
Hint for buffer pre-allocation size.
This method provides a size hint for how much buffer space to pre-allocate before serializing this type. Accurate hints improve performance by reducing buffer reallocations.
§Returns
- Estimated maximum size in bytes for this type
0if unknown or variable size (default)
§Implementation Guidelines
Return a conservative upper bound:
fn fory_reserved_space() -> usize {
std::mem::size_of::<Self>() + overhead
}§Examples
- Fixed-size struct:
std::mem::size_of::<Self>() + metadata_size - Variable-size: Return
0(collections, strings)
§Implementation Notes
- Default returns
0(no pre-allocation) - Fory implements size hints for fixed-size types
- User types with custom serialization can override for performance
- Overestimation wastes memory; underestimation requires reallocation
Trait Implementations§
Source§impl ForyDefault for Box<dyn Serializer>
impl ForyDefault for Box<dyn Serializer>
Source§fn fory_default() -> Box<dyn Serializer>
fn fory_default() -> Box<dyn Serializer>
Source§impl Serializer for Box<dyn Serializer>
impl Serializer for Box<dyn Serializer>
Source§fn fory_concrete_type_id(&self) -> TypeId
fn fory_concrete_type_id(&self) -> TypeId
std::any::TypeId for this instance. Read moreSource§fn fory_write(
&self,
context: &mut WriteContext<'_>,
ref_mode: RefMode,
write_type_info: bool,
has_generics: bool,
) -> Result<(), Error>
fn fory_write( &self, context: &mut WriteContext<'_>, ref_mode: RefMode, write_type_info: bool, has_generics: bool, ) -> Result<(), Error>
Source§fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
Source§fn fory_write_data_generic(
&self,
context: &mut WriteContext<'_>,
has_generics: bool,
) -> Result<(), Error>
fn fory_write_data_generic( &self, context: &mut WriteContext<'_>, has_generics: bool, ) -> Result<(), Error>
Source§fn fory_type_id_dyn(
&self,
type_resolver: &TypeResolver,
) -> Result<TypeId, Error>
fn fory_type_id_dyn( &self, type_resolver: &TypeResolver, ) -> Result<TypeId, Error>
Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&dyn Any for dynamic type checking. Read moreSource§fn fory_is_polymorphic() -> bool
fn fory_is_polymorphic() -> bool
Source§fn fory_write_type_info(_context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_write_type_info(_context: &mut WriteContext<'_>) -> Result<(), Error>
Source§fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
Source§fn fory_read(
context: &mut ReadContext<'_>,
ref_mode: RefMode,
read_type_info: bool,
) -> Result<Box<dyn Serializer>, Error>
fn fory_read( context: &mut ReadContext<'_>, ref_mode: RefMode, read_type_info: bool, ) -> Result<Box<dyn Serializer>, Error>
Source§fn fory_read_with_type_info(
context: &mut ReadContext<'_>,
ref_mode: RefMode,
type_info: Rc<TypeInfo>,
) -> Result<Box<dyn Serializer>, Error>
fn fory_read_with_type_info( context: &mut ReadContext<'_>, ref_mode: RefMode, type_info: Rc<TypeInfo>, ) -> Result<Box<dyn Serializer>, Error>
Source§fn fory_read_data(
_context: &mut ReadContext<'_>,
) -> Result<Box<dyn Serializer>, Error>
fn fory_read_data( _context: &mut ReadContext<'_>, ) -> Result<Box<dyn Serializer>, Error>
Source§fn fory_is_none(&self) -> bool
fn fory_is_none(&self) -> bool
None value. Read morefn fory_is_wrapper_type() -> boolwhere
Self: Sized,
Source§fn fory_static_type_id() -> TypeIdwhere
Self: Sized,
fn fory_static_type_id() -> TypeIdwhere
Self: Sized,
Source§fn fory_get_type_id(type_resolver: &TypeResolver) -> Result<TypeId, Error>where
Self: Sized,
fn fory_get_type_id(type_resolver: &TypeResolver) -> Result<TypeId, Error>where
Self: Sized,
fn fory_get_type_info(
type_resolver: &TypeResolver,
) -> Result<Rc<TypeInfo>, Error>where
Self: Sized,
Implementations on Foreign Types§
Source§impl Serializer for bool
impl Serializer for bool
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data(context: &mut ReadContext<'_>) -> Result<bool, Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn as_any(&self) -> &(dyn Any + 'static)
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
Source§impl Serializer for f32
impl Serializer for f32
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data(context: &mut ReadContext<'_>) -> Result<f32, Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn as_any(&self) -> &(dyn Any + 'static)
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
Source§impl Serializer for f64
impl Serializer for f64
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data(context: &mut ReadContext<'_>) -> Result<f64, Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn as_any(&self) -> &(dyn Any + 'static)
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
Source§impl Serializer for i8
impl Serializer for i8
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data(context: &mut ReadContext<'_>) -> Result<i8, Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn as_any(&self) -> &(dyn Any + 'static)
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
Source§impl Serializer for i16
impl Serializer for i16
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data(context: &mut ReadContext<'_>) -> Result<i16, Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn as_any(&self) -> &(dyn Any + 'static)
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
Source§impl Serializer for i32
impl Serializer for i32
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data(context: &mut ReadContext<'_>) -> Result<i32, Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn as_any(&self) -> &(dyn Any + 'static)
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
Source§impl Serializer for i64
impl Serializer for i64
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data(context: &mut ReadContext<'_>) -> Result<i64, Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn as_any(&self) -> &(dyn Any + 'static)
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
Source§impl Serializer for i128
impl Serializer for i128
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data(context: &mut ReadContext<'_>) -> Result<i128, Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn as_any(&self) -> &(dyn Any + 'static)
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
Source§impl Serializer for isize
impl Serializer for isize
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data(context: &mut ReadContext<'_>) -> Result<isize, Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn as_any(&self) -> &(dyn Any + 'static)
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
Source§impl Serializer for u8
impl Serializer for u8
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data(context: &mut ReadContext<'_>) -> Result<u8, Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn as_any(&self) -> &(dyn Any + 'static)
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
Source§impl Serializer for u16
impl Serializer for u16
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data(context: &mut ReadContext<'_>) -> Result<u16, Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn as_any(&self) -> &(dyn Any + 'static)
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
Source§impl Serializer for u32
impl Serializer for u32
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data(context: &mut ReadContext<'_>) -> Result<u32, Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn as_any(&self) -> &(dyn Any + 'static)
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
Source§impl Serializer for u64
impl Serializer for u64
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data(context: &mut ReadContext<'_>) -> Result<u64, Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn as_any(&self) -> &(dyn Any + 'static)
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
Source§impl Serializer for u128
impl Serializer for u128
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data(context: &mut ReadContext<'_>) -> Result<u128, Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn as_any(&self) -> &(dyn Any + 'static)
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
Source§impl Serializer for ()
impl Serializer for ()
fn fory_write_data(&self, _context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data(_context: &mut ReadContext<'_>) -> Result<(), Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn as_any(&self) -> &(dyn Any + 'static)
Source§impl Serializer for usize
impl Serializer for usize
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data(context: &mut ReadContext<'_>) -> Result<usize, Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn as_any(&self) -> &(dyn Any + 'static)
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
Source§impl Serializer for Box<dyn Any>
impl Serializer for Box<dyn Any>
fn fory_write( &self, context: &mut WriteContext<'_>, ref_mode: RefMode, write_type_info: bool, has_generics: bool, ) -> Result<(), Error>
fn fory_write_data_generic( &self, context: &mut WriteContext<'_>, has_generics: bool, ) -> Result<(), Error>
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read( context: &mut ReadContext<'_>, ref_mode: RefMode, read_type_info: bool, ) -> Result<Box<dyn Any>, Error>
fn fory_read_with_type_info( context: &mut ReadContext<'_>, ref_mode: RefMode, type_info: Rc<TypeInfo>, ) -> Result<Box<dyn Any>, Error>
fn fory_read_data(_: &mut ReadContext<'_>) -> Result<Box<dyn Any>, Error>
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn( &self, type_resolver: &TypeResolver, ) -> Result<TypeId, Error>
fn fory_concrete_type_id(&self) -> TypeId
fn fory_is_polymorphic() -> bool
fn fory_static_type_id() -> TypeId
fn fory_write_type_info(_context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_type_info(_context: &mut ReadContext<'_>) -> Result<(), Error>
fn as_any(&self) -> &(dyn Any + 'static)
Source§impl Serializer for Box<dyn Serializer>
impl Serializer for Box<dyn Serializer>
fn fory_concrete_type_id(&self) -> TypeId
fn fory_write( &self, context: &mut WriteContext<'_>, ref_mode: RefMode, write_type_info: bool, has_generics: bool, ) -> Result<(), Error>
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_write_data_generic( &self, context: &mut WriteContext<'_>, has_generics: bool, ) -> Result<(), Error>
fn fory_type_id_dyn( &self, type_resolver: &TypeResolver, ) -> Result<TypeId, Error>
fn as_any(&self) -> &(dyn Any + 'static)
fn fory_is_polymorphic() -> bool
fn fory_write_type_info(_context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
fn fory_read( context: &mut ReadContext<'_>, ref_mode: RefMode, read_type_info: bool, ) -> Result<Box<dyn Serializer>, Error>
fn fory_read_with_type_info( context: &mut ReadContext<'_>, ref_mode: RefMode, type_info: Rc<TypeInfo>, ) -> Result<Box<dyn Serializer>, Error>
fn fory_read_data( _context: &mut ReadContext<'_>, ) -> Result<Box<dyn Serializer>, Error>
Source§impl Serializer for Rc<dyn Any>
impl Serializer for Rc<dyn Any>
fn fory_write( &self, context: &mut WriteContext<'_>, ref_mode: RefMode, write_type_info: bool, has_generics: bool, ) -> Result<(), Error>
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_write_data_generic( &self, context: &mut WriteContext<'_>, has_generics: bool, ) -> Result<(), Error>
fn fory_read( context: &mut ReadContext<'_>, ref_mode: RefMode, read_type_info: bool, ) -> Result<Rc<dyn Any>, Error>
fn fory_read_with_type_info( context: &mut ReadContext<'_>, ref_mode: RefMode, type_info: Rc<TypeInfo>, ) -> Result<Rc<dyn Any>, Error>
fn fory_read_data(_: &mut ReadContext<'_>) -> Result<Rc<dyn Any>, Error>
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn( &self, type_resolver: &TypeResolver, ) -> Result<TypeId, Error>
fn fory_concrete_type_id(&self) -> TypeId
fn fory_is_polymorphic() -> bool
fn fory_static_type_id() -> TypeId
fn fory_write_type_info(_context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_type_info(_context: &mut ReadContext<'_>) -> Result<(), Error>
fn as_any(&self) -> &(dyn Any + 'static)
Source§impl Serializer for String
impl Serializer for String
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data(context: &mut ReadContext<'_>) -> Result<String, Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn as_any(&self) -> &(dyn Any + 'static)
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
Source§impl Serializer for Arc<dyn Any>
impl Serializer for Arc<dyn Any>
fn fory_write( &self, context: &mut WriteContext<'_>, ref_mode: RefMode, write_type_info: bool, has_generics: bool, ) -> Result<(), Error>
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_write_data_generic( &self, context: &mut WriteContext<'_>, has_generics: bool, ) -> Result<(), Error>
fn fory_read( context: &mut ReadContext<'_>, ref_mode: RefMode, read_type_info: bool, ) -> Result<Arc<dyn Any>, Error>
fn fory_read_with_type_info( context: &mut ReadContext<'_>, ref_mode: RefMode, type_info: Rc<TypeInfo>, ) -> Result<Arc<dyn Any>, Error>
fn fory_read_data(_: &mut ReadContext<'_>) -> Result<Arc<dyn Any>, Error>
fn fory_get_type_id(_type_resolver: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn( &self, type_resolver: &TypeResolver, ) -> Result<TypeId, Error>
fn fory_concrete_type_id(&self) -> TypeId
fn fory_is_polymorphic() -> bool
fn fory_static_type_id() -> TypeId
fn fory_write_type_info(_context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_type_info(_context: &mut ReadContext<'_>) -> Result<(), Error>
fn as_any(&self) -> &(dyn Any + 'static)
Source§impl Serializer for Duration
impl Serializer for Duration
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data(context: &mut ReadContext<'_>) -> Result<Duration, Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn as_any(&self) -> &(dyn Any + 'static)
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
Source§impl Serializer for NaiveDate
impl Serializer for NaiveDate
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data(context: &mut ReadContext<'_>) -> Result<NaiveDate, Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn as_any(&self) -> &(dyn Any + 'static)
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
Source§impl Serializer for NaiveDateTime
impl Serializer for NaiveDateTime
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data(context: &mut ReadContext<'_>) -> Result<NaiveDateTime, Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn as_any(&self) -> &(dyn Any + 'static)
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
Source§impl<K, V> Serializer for BTreeMap<K, V>
impl<K, V> Serializer for BTreeMap<K, V>
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_write_data_generic( &self, context: &mut WriteContext<'_>, has_generics: bool, ) -> Result<(), Error>
fn fory_read_data( context: &mut ReadContext<'_>, ) -> Result<BTreeMap<K, V>, Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn as_any(&self) -> &(dyn Any + 'static)
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
Source§impl<K, V> Serializer for HashMap<K, V>
impl<K, V> Serializer for HashMap<K, V>
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_write_data_generic( &self, context: &mut WriteContext<'_>, has_generics: bool, ) -> Result<(), Error>
fn fory_read_data(context: &mut ReadContext<'_>) -> Result<HashMap<K, V>, Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn as_any(&self) -> &(dyn Any + 'static)
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
Source§impl<T0> Serializer for (T0,)where
T0: Serializer + ForyDefault,
impl<T0> Serializer for (T0,)where
T0: Serializer + ForyDefault,
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data(context: &mut ReadContext<'_>) -> Result<(T0,), Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn fory_is_wrapper_type() -> bool
fn as_any(&self) -> &(dyn Any + 'static)
Source§impl<T0, T1> Serializer for (T0, T1)
impl<T0, T1> Serializer for (T0, T1)
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data(context: &mut ReadContext<'_>) -> Result<(T0, T1), Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn fory_is_wrapper_type() -> bool
fn as_any(&self) -> &(dyn Any + 'static)
Source§impl<T0, T1, T2> Serializer for (T0, T1, T2)
impl<T0, T1, T2> Serializer for (T0, T1, T2)
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data(context: &mut ReadContext<'_>) -> Result<(T0, T1, T2), Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn fory_is_wrapper_type() -> boolwhere
(T0, T1, T2): Sized,
fn as_any(&self) -> &(dyn Any + 'static)
Source§impl<T0, T1, T2, T3> Serializer for (T0, T1, T2, T3)where
T0: Serializer + ForyDefault,
T1: Serializer + ForyDefault,
T2: Serializer + ForyDefault,
T3: Serializer + ForyDefault,
impl<T0, T1, T2, T3> Serializer for (T0, T1, T2, T3)where
T0: Serializer + ForyDefault,
T1: Serializer + ForyDefault,
T2: Serializer + ForyDefault,
T3: Serializer + ForyDefault,
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data( context: &mut ReadContext<'_>, ) -> Result<(T0, T1, T2, T3), Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn fory_is_wrapper_type() -> boolwhere
(T0, T1, T2, T3): Sized,
fn as_any(&self) -> &(dyn Any + 'static)
Source§impl<T0, T1, T2, T3, T4> Serializer for (T0, T1, T2, T3, T4)where
T0: Serializer + ForyDefault,
T1: Serializer + ForyDefault,
T2: Serializer + ForyDefault,
T3: Serializer + ForyDefault,
T4: Serializer + ForyDefault,
impl<T0, T1, T2, T3, T4> Serializer for (T0, T1, T2, T3, T4)where
T0: Serializer + ForyDefault,
T1: Serializer + ForyDefault,
T2: Serializer + ForyDefault,
T3: Serializer + ForyDefault,
T4: Serializer + ForyDefault,
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data( context: &mut ReadContext<'_>, ) -> Result<(T0, T1, T2, T3, T4), Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn fory_is_wrapper_type() -> boolwhere
(T0, T1, T2, T3, T4): Sized,
fn as_any(&self) -> &(dyn Any + 'static)
Source§impl<T0, T1, T2, T3, T4, T5> Serializer for (T0, T1, T2, T3, T4, T5)where
T0: Serializer + ForyDefault,
T1: Serializer + ForyDefault,
T2: Serializer + ForyDefault,
T3: Serializer + ForyDefault,
T4: Serializer + ForyDefault,
T5: Serializer + ForyDefault,
impl<T0, T1, T2, T3, T4, T5> Serializer for (T0, T1, T2, T3, T4, T5)where
T0: Serializer + ForyDefault,
T1: Serializer + ForyDefault,
T2: Serializer + ForyDefault,
T3: Serializer + ForyDefault,
T4: Serializer + ForyDefault,
T5: Serializer + ForyDefault,
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data( context: &mut ReadContext<'_>, ) -> Result<(T0, T1, T2, T3, T4, T5), Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn fory_is_wrapper_type() -> boolwhere
(T0, T1, T2, T3, T4, T5): Sized,
fn as_any(&self) -> &(dyn Any + 'static)
Source§impl<T0, T1, T2, T3, T4, T5, T6> Serializer for (T0, T1, T2, T3, T4, T5, T6)where
T0: Serializer + ForyDefault,
T1: Serializer + ForyDefault,
T2: Serializer + ForyDefault,
T3: Serializer + ForyDefault,
T4: Serializer + ForyDefault,
T5: Serializer + ForyDefault,
T6: Serializer + ForyDefault,
impl<T0, T1, T2, T3, T4, T5, T6> Serializer for (T0, T1, T2, T3, T4, T5, T6)where
T0: Serializer + ForyDefault,
T1: Serializer + ForyDefault,
T2: Serializer + ForyDefault,
T3: Serializer + ForyDefault,
T4: Serializer + ForyDefault,
T5: Serializer + ForyDefault,
T6: Serializer + ForyDefault,
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data( context: &mut ReadContext<'_>, ) -> Result<(T0, T1, T2, T3, T4, T5, T6), Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn fory_is_wrapper_type() -> boolwhere
(T0, T1, T2, T3, T4, T5, T6): Sized,
fn as_any(&self) -> &(dyn Any + 'static)
Source§impl<T0, T1, T2, T3, T4, T5, T6, T7> Serializer for (T0, T1, T2, T3, T4, T5, T6, T7)where
T0: Serializer + ForyDefault,
T1: Serializer + ForyDefault,
T2: Serializer + ForyDefault,
T3: Serializer + ForyDefault,
T4: Serializer + ForyDefault,
T5: Serializer + ForyDefault,
T6: Serializer + ForyDefault,
T7: Serializer + ForyDefault,
impl<T0, T1, T2, T3, T4, T5, T6, T7> Serializer for (T0, T1, T2, T3, T4, T5, T6, T7)where
T0: Serializer + ForyDefault,
T1: Serializer + ForyDefault,
T2: Serializer + ForyDefault,
T3: Serializer + ForyDefault,
T4: Serializer + ForyDefault,
T5: Serializer + ForyDefault,
T6: Serializer + ForyDefault,
T7: Serializer + ForyDefault,
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data( context: &mut ReadContext<'_>, ) -> Result<(T0, T1, T2, T3, T4, T5, T6, T7), Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn fory_is_wrapper_type() -> bool
fn as_any(&self) -> &(dyn Any + 'static)
Source§impl<T0, T1, T2, T3, T4, T5, T6, T7, T8> Serializer for (T0, T1, T2, T3, T4, T5, T6, T7, T8)where
T0: Serializer + ForyDefault,
T1: Serializer + ForyDefault,
T2: Serializer + ForyDefault,
T3: Serializer + ForyDefault,
T4: Serializer + ForyDefault,
T5: Serializer + ForyDefault,
T6: Serializer + ForyDefault,
T7: Serializer + ForyDefault,
T8: Serializer + ForyDefault,
impl<T0, T1, T2, T3, T4, T5, T6, T7, T8> Serializer for (T0, T1, T2, T3, T4, T5, T6, T7, T8)where
T0: Serializer + ForyDefault,
T1: Serializer + ForyDefault,
T2: Serializer + ForyDefault,
T3: Serializer + ForyDefault,
T4: Serializer + ForyDefault,
T5: Serializer + ForyDefault,
T6: Serializer + ForyDefault,
T7: Serializer + ForyDefault,
T8: Serializer + ForyDefault,
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data( context: &mut ReadContext<'_>, ) -> Result<(T0, T1, T2, T3, T4, T5, T6, T7, T8), Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn fory_is_wrapper_type() -> bool
fn as_any(&self) -> &(dyn Any + 'static)
Source§impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> Serializer for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)where
T0: Serializer + ForyDefault,
T1: Serializer + ForyDefault,
T2: Serializer + ForyDefault,
T3: Serializer + ForyDefault,
T4: Serializer + ForyDefault,
T5: Serializer + ForyDefault,
T6: Serializer + ForyDefault,
T7: Serializer + ForyDefault,
T8: Serializer + ForyDefault,
T9: Serializer + ForyDefault,
impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> Serializer for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)where
T0: Serializer + ForyDefault,
T1: Serializer + ForyDefault,
T2: Serializer + ForyDefault,
T3: Serializer + ForyDefault,
T4: Serializer + ForyDefault,
T5: Serializer + ForyDefault,
T6: Serializer + ForyDefault,
T7: Serializer + ForyDefault,
T8: Serializer + ForyDefault,
T9: Serializer + ForyDefault,
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data( context: &mut ReadContext<'_>, ) -> Result<(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9), Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn fory_is_wrapper_type() -> bool
fn as_any(&self) -> &(dyn Any + 'static)
Source§impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Serializer for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)where
T0: Serializer + ForyDefault,
T1: Serializer + ForyDefault,
T2: Serializer + ForyDefault,
T3: Serializer + ForyDefault,
T4: Serializer + ForyDefault,
T5: Serializer + ForyDefault,
T6: Serializer + ForyDefault,
T7: Serializer + ForyDefault,
T8: Serializer + ForyDefault,
T9: Serializer + ForyDefault,
T10: Serializer + ForyDefault,
impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Serializer for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)where
T0: Serializer + ForyDefault,
T1: Serializer + ForyDefault,
T2: Serializer + ForyDefault,
T3: Serializer + ForyDefault,
T4: Serializer + ForyDefault,
T5: Serializer + ForyDefault,
T6: Serializer + ForyDefault,
T7: Serializer + ForyDefault,
T8: Serializer + ForyDefault,
T9: Serializer + ForyDefault,
T10: Serializer + ForyDefault,
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data( context: &mut ReadContext<'_>, ) -> Result<(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10), Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn fory_is_wrapper_type() -> bool
fn as_any(&self) -> &(dyn Any + 'static)
Source§impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Serializer for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)where
T0: Serializer + ForyDefault,
T1: Serializer + ForyDefault,
T2: Serializer + ForyDefault,
T3: Serializer + ForyDefault,
T4: Serializer + ForyDefault,
T5: Serializer + ForyDefault,
T6: Serializer + ForyDefault,
T7: Serializer + ForyDefault,
T8: Serializer + ForyDefault,
T9: Serializer + ForyDefault,
T10: Serializer + ForyDefault,
T11: Serializer + ForyDefault,
impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Serializer for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)where
T0: Serializer + ForyDefault,
T1: Serializer + ForyDefault,
T2: Serializer + ForyDefault,
T3: Serializer + ForyDefault,
T4: Serializer + ForyDefault,
T5: Serializer + ForyDefault,
T6: Serializer + ForyDefault,
T7: Serializer + ForyDefault,
T8: Serializer + ForyDefault,
T9: Serializer + ForyDefault,
T10: Serializer + ForyDefault,
T11: Serializer + ForyDefault,
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data( context: &mut ReadContext<'_>, ) -> Result<(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11), Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn fory_is_wrapper_type() -> bool
fn as_any(&self) -> &(dyn Any + 'static)
Source§impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Serializer for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)where
T0: Serializer + ForyDefault,
T1: Serializer + ForyDefault,
T2: Serializer + ForyDefault,
T3: Serializer + ForyDefault,
T4: Serializer + ForyDefault,
T5: Serializer + ForyDefault,
T6: Serializer + ForyDefault,
T7: Serializer + ForyDefault,
T8: Serializer + ForyDefault,
T9: Serializer + ForyDefault,
T10: Serializer + ForyDefault,
T11: Serializer + ForyDefault,
T12: Serializer + ForyDefault,
impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Serializer for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)where
T0: Serializer + ForyDefault,
T1: Serializer + ForyDefault,
T2: Serializer + ForyDefault,
T3: Serializer + ForyDefault,
T4: Serializer + ForyDefault,
T5: Serializer + ForyDefault,
T6: Serializer + ForyDefault,
T7: Serializer + ForyDefault,
T8: Serializer + ForyDefault,
T9: Serializer + ForyDefault,
T10: Serializer + ForyDefault,
T11: Serializer + ForyDefault,
T12: Serializer + ForyDefault,
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data( context: &mut ReadContext<'_>, ) -> Result<(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12), Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn fory_is_wrapper_type() -> bool
fn as_any(&self) -> &(dyn Any + 'static)
Source§impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Serializer for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)where
T0: Serializer + ForyDefault,
T1: Serializer + ForyDefault,
T2: Serializer + ForyDefault,
T3: Serializer + ForyDefault,
T4: Serializer + ForyDefault,
T5: Serializer + ForyDefault,
T6: Serializer + ForyDefault,
T7: Serializer + ForyDefault,
T8: Serializer + ForyDefault,
T9: Serializer + ForyDefault,
T10: Serializer + ForyDefault,
T11: Serializer + ForyDefault,
T12: Serializer + ForyDefault,
T13: Serializer + ForyDefault,
impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Serializer for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)where
T0: Serializer + ForyDefault,
T1: Serializer + ForyDefault,
T2: Serializer + ForyDefault,
T3: Serializer + ForyDefault,
T4: Serializer + ForyDefault,
T5: Serializer + ForyDefault,
T6: Serializer + ForyDefault,
T7: Serializer + ForyDefault,
T8: Serializer + ForyDefault,
T9: Serializer + ForyDefault,
T10: Serializer + ForyDefault,
T11: Serializer + ForyDefault,
T12: Serializer + ForyDefault,
T13: Serializer + ForyDefault,
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data( context: &mut ReadContext<'_>, ) -> Result<(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13), Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn fory_is_wrapper_type() -> bool
fn as_any(&self) -> &(dyn Any + 'static)
Source§impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Serializer for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)where
T0: Serializer + ForyDefault,
T1: Serializer + ForyDefault,
T2: Serializer + ForyDefault,
T3: Serializer + ForyDefault,
T4: Serializer + ForyDefault,
T5: Serializer + ForyDefault,
T6: Serializer + ForyDefault,
T7: Serializer + ForyDefault,
T8: Serializer + ForyDefault,
T9: Serializer + ForyDefault,
T10: Serializer + ForyDefault,
T11: Serializer + ForyDefault,
T12: Serializer + ForyDefault,
T13: Serializer + ForyDefault,
T14: Serializer + ForyDefault,
impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Serializer for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)where
T0: Serializer + ForyDefault,
T1: Serializer + ForyDefault,
T2: Serializer + ForyDefault,
T3: Serializer + ForyDefault,
T4: Serializer + ForyDefault,
T5: Serializer + ForyDefault,
T6: Serializer + ForyDefault,
T7: Serializer + ForyDefault,
T8: Serializer + ForyDefault,
T9: Serializer + ForyDefault,
T10: Serializer + ForyDefault,
T11: Serializer + ForyDefault,
T12: Serializer + ForyDefault,
T13: Serializer + ForyDefault,
T14: Serializer + ForyDefault,
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data( context: &mut ReadContext<'_>, ) -> Result<(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14), Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn fory_is_wrapper_type() -> bool
fn as_any(&self) -> &(dyn Any + 'static)
Source§impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> Serializer for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)where
T0: Serializer + ForyDefault,
T1: Serializer + ForyDefault,
T2: Serializer + ForyDefault,
T3: Serializer + ForyDefault,
T4: Serializer + ForyDefault,
T5: Serializer + ForyDefault,
T6: Serializer + ForyDefault,
T7: Serializer + ForyDefault,
T8: Serializer + ForyDefault,
T9: Serializer + ForyDefault,
T10: Serializer + ForyDefault,
T11: Serializer + ForyDefault,
T12: Serializer + ForyDefault,
T13: Serializer + ForyDefault,
T14: Serializer + ForyDefault,
T15: Serializer + ForyDefault,
impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> Serializer for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)where
T0: Serializer + ForyDefault,
T1: Serializer + ForyDefault,
T2: Serializer + ForyDefault,
T3: Serializer + ForyDefault,
T4: Serializer + ForyDefault,
T5: Serializer + ForyDefault,
T6: Serializer + ForyDefault,
T7: Serializer + ForyDefault,
T8: Serializer + ForyDefault,
T9: Serializer + ForyDefault,
T10: Serializer + ForyDefault,
T11: Serializer + ForyDefault,
T12: Serializer + ForyDefault,
T13: Serializer + ForyDefault,
T14: Serializer + ForyDefault,
T15: Serializer + ForyDefault,
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data( context: &mut ReadContext<'_>, ) -> Result<(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15), Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn fory_is_wrapper_type() -> bool
fn as_any(&self) -> &(dyn Any + 'static)
Source§impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> Serializer for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)where
T0: Serializer + ForyDefault,
T1: Serializer + ForyDefault,
T2: Serializer + ForyDefault,
T3: Serializer + ForyDefault,
T4: Serializer + ForyDefault,
T5: Serializer + ForyDefault,
T6: Serializer + ForyDefault,
T7: Serializer + ForyDefault,
T8: Serializer + ForyDefault,
T9: Serializer + ForyDefault,
T10: Serializer + ForyDefault,
T11: Serializer + ForyDefault,
T12: Serializer + ForyDefault,
T13: Serializer + ForyDefault,
T14: Serializer + ForyDefault,
T15: Serializer + ForyDefault,
T16: Serializer + ForyDefault,
impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> Serializer for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)where
T0: Serializer + ForyDefault,
T1: Serializer + ForyDefault,
T2: Serializer + ForyDefault,
T3: Serializer + ForyDefault,
T4: Serializer + ForyDefault,
T5: Serializer + ForyDefault,
T6: Serializer + ForyDefault,
T7: Serializer + ForyDefault,
T8: Serializer + ForyDefault,
T9: Serializer + ForyDefault,
T10: Serializer + ForyDefault,
T11: Serializer + ForyDefault,
T12: Serializer + ForyDefault,
T13: Serializer + ForyDefault,
T14: Serializer + ForyDefault,
T15: Serializer + ForyDefault,
T16: Serializer + ForyDefault,
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data( context: &mut ReadContext<'_>, ) -> Result<(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16), Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn fory_is_wrapper_type() -> bool
fn as_any(&self) -> &(dyn Any + 'static)
Source§impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> Serializer for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17)where
T0: Serializer + ForyDefault,
T1: Serializer + ForyDefault,
T2: Serializer + ForyDefault,
T3: Serializer + ForyDefault,
T4: Serializer + ForyDefault,
T5: Serializer + ForyDefault,
T6: Serializer + ForyDefault,
T7: Serializer + ForyDefault,
T8: Serializer + ForyDefault,
T9: Serializer + ForyDefault,
T10: Serializer + ForyDefault,
T11: Serializer + ForyDefault,
T12: Serializer + ForyDefault,
T13: Serializer + ForyDefault,
T14: Serializer + ForyDefault,
T15: Serializer + ForyDefault,
T16: Serializer + ForyDefault,
T17: Serializer + ForyDefault,
impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> Serializer for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17)where
T0: Serializer + ForyDefault,
T1: Serializer + ForyDefault,
T2: Serializer + ForyDefault,
T3: Serializer + ForyDefault,
T4: Serializer + ForyDefault,
T5: Serializer + ForyDefault,
T6: Serializer + ForyDefault,
T7: Serializer + ForyDefault,
T8: Serializer + ForyDefault,
T9: Serializer + ForyDefault,
T10: Serializer + ForyDefault,
T11: Serializer + ForyDefault,
T12: Serializer + ForyDefault,
T13: Serializer + ForyDefault,
T14: Serializer + ForyDefault,
T15: Serializer + ForyDefault,
T16: Serializer + ForyDefault,
T17: Serializer + ForyDefault,
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data( context: &mut ReadContext<'_>, ) -> Result<(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17), Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn fory_is_wrapper_type() -> bool
fn as_any(&self) -> &(dyn Any + 'static)
Source§impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> Serializer for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18)where
T0: Serializer + ForyDefault,
T1: Serializer + ForyDefault,
T2: Serializer + ForyDefault,
T3: Serializer + ForyDefault,
T4: Serializer + ForyDefault,
T5: Serializer + ForyDefault,
T6: Serializer + ForyDefault,
T7: Serializer + ForyDefault,
T8: Serializer + ForyDefault,
T9: Serializer + ForyDefault,
T10: Serializer + ForyDefault,
T11: Serializer + ForyDefault,
T12: Serializer + ForyDefault,
T13: Serializer + ForyDefault,
T14: Serializer + ForyDefault,
T15: Serializer + ForyDefault,
T16: Serializer + ForyDefault,
T17: Serializer + ForyDefault,
T18: Serializer + ForyDefault,
impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> Serializer for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18)where
T0: Serializer + ForyDefault,
T1: Serializer + ForyDefault,
T2: Serializer + ForyDefault,
T3: Serializer + ForyDefault,
T4: Serializer + ForyDefault,
T5: Serializer + ForyDefault,
T6: Serializer + ForyDefault,
T7: Serializer + ForyDefault,
T8: Serializer + ForyDefault,
T9: Serializer + ForyDefault,
T10: Serializer + ForyDefault,
T11: Serializer + ForyDefault,
T12: Serializer + ForyDefault,
T13: Serializer + ForyDefault,
T14: Serializer + ForyDefault,
T15: Serializer + ForyDefault,
T16: Serializer + ForyDefault,
T17: Serializer + ForyDefault,
T18: Serializer + ForyDefault,
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data( context: &mut ReadContext<'_>, ) -> Result<(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18), Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn fory_is_wrapper_type() -> bool
fn as_any(&self) -> &(dyn Any + 'static)
Source§impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> Serializer for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19)where
T0: Serializer + ForyDefault,
T1: Serializer + ForyDefault,
T2: Serializer + ForyDefault,
T3: Serializer + ForyDefault,
T4: Serializer + ForyDefault,
T5: Serializer + ForyDefault,
T6: Serializer + ForyDefault,
T7: Serializer + ForyDefault,
T8: Serializer + ForyDefault,
T9: Serializer + ForyDefault,
T10: Serializer + ForyDefault,
T11: Serializer + ForyDefault,
T12: Serializer + ForyDefault,
T13: Serializer + ForyDefault,
T14: Serializer + ForyDefault,
T15: Serializer + ForyDefault,
T16: Serializer + ForyDefault,
T17: Serializer + ForyDefault,
T18: Serializer + ForyDefault,
T19: Serializer + ForyDefault,
impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> Serializer for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19)where
T0: Serializer + ForyDefault,
T1: Serializer + ForyDefault,
T2: Serializer + ForyDefault,
T3: Serializer + ForyDefault,
T4: Serializer + ForyDefault,
T5: Serializer + ForyDefault,
T6: Serializer + ForyDefault,
T7: Serializer + ForyDefault,
T8: Serializer + ForyDefault,
T9: Serializer + ForyDefault,
T10: Serializer + ForyDefault,
T11: Serializer + ForyDefault,
T12: Serializer + ForyDefault,
T13: Serializer + ForyDefault,
T14: Serializer + ForyDefault,
T15: Serializer + ForyDefault,
T16: Serializer + ForyDefault,
T17: Serializer + ForyDefault,
T18: Serializer + ForyDefault,
T19: Serializer + ForyDefault,
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data( context: &mut ReadContext<'_>, ) -> Result<(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19), Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn fory_is_wrapper_type() -> bool
fn as_any(&self) -> &(dyn Any + 'static)
Source§impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> Serializer for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20)where
T0: Serializer + ForyDefault,
T1: Serializer + ForyDefault,
T2: Serializer + ForyDefault,
T3: Serializer + ForyDefault,
T4: Serializer + ForyDefault,
T5: Serializer + ForyDefault,
T6: Serializer + ForyDefault,
T7: Serializer + ForyDefault,
T8: Serializer + ForyDefault,
T9: Serializer + ForyDefault,
T10: Serializer + ForyDefault,
T11: Serializer + ForyDefault,
T12: Serializer + ForyDefault,
T13: Serializer + ForyDefault,
T14: Serializer + ForyDefault,
T15: Serializer + ForyDefault,
T16: Serializer + ForyDefault,
T17: Serializer + ForyDefault,
T18: Serializer + ForyDefault,
T19: Serializer + ForyDefault,
T20: Serializer + ForyDefault,
impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> Serializer for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20)where
T0: Serializer + ForyDefault,
T1: Serializer + ForyDefault,
T2: Serializer + ForyDefault,
T3: Serializer + ForyDefault,
T4: Serializer + ForyDefault,
T5: Serializer + ForyDefault,
T6: Serializer + ForyDefault,
T7: Serializer + ForyDefault,
T8: Serializer + ForyDefault,
T9: Serializer + ForyDefault,
T10: Serializer + ForyDefault,
T11: Serializer + ForyDefault,
T12: Serializer + ForyDefault,
T13: Serializer + ForyDefault,
T14: Serializer + ForyDefault,
T15: Serializer + ForyDefault,
T16: Serializer + ForyDefault,
T17: Serializer + ForyDefault,
T18: Serializer + ForyDefault,
T19: Serializer + ForyDefault,
T20: Serializer + ForyDefault,
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data( context: &mut ReadContext<'_>, ) -> Result<(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20), Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn fory_is_wrapper_type() -> bool
fn as_any(&self) -> &(dyn Any + 'static)
Source§impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21> Serializer for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21)where
T0: Serializer + ForyDefault,
T1: Serializer + ForyDefault,
T2: Serializer + ForyDefault,
T3: Serializer + ForyDefault,
T4: Serializer + ForyDefault,
T5: Serializer + ForyDefault,
T6: Serializer + ForyDefault,
T7: Serializer + ForyDefault,
T8: Serializer + ForyDefault,
T9: Serializer + ForyDefault,
T10: Serializer + ForyDefault,
T11: Serializer + ForyDefault,
T12: Serializer + ForyDefault,
T13: Serializer + ForyDefault,
T14: Serializer + ForyDefault,
T15: Serializer + ForyDefault,
T16: Serializer + ForyDefault,
T17: Serializer + ForyDefault,
T18: Serializer + ForyDefault,
T19: Serializer + ForyDefault,
T20: Serializer + ForyDefault,
T21: Serializer + ForyDefault,
impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21> Serializer for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21)where
T0: Serializer + ForyDefault,
T1: Serializer + ForyDefault,
T2: Serializer + ForyDefault,
T3: Serializer + ForyDefault,
T4: Serializer + ForyDefault,
T5: Serializer + ForyDefault,
T6: Serializer + ForyDefault,
T7: Serializer + ForyDefault,
T8: Serializer + ForyDefault,
T9: Serializer + ForyDefault,
T10: Serializer + ForyDefault,
T11: Serializer + ForyDefault,
T12: Serializer + ForyDefault,
T13: Serializer + ForyDefault,
T14: Serializer + ForyDefault,
T15: Serializer + ForyDefault,
T16: Serializer + ForyDefault,
T17: Serializer + ForyDefault,
T18: Serializer + ForyDefault,
T19: Serializer + ForyDefault,
T20: Serializer + ForyDefault,
T21: Serializer + ForyDefault,
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data( context: &mut ReadContext<'_>, ) -> Result<(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21), Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn fory_is_wrapper_type() -> bool
fn as_any(&self) -> &(dyn Any + 'static)
Source§impl<T> Serializer for Option<T>where
T: Serializer + ForyDefault,
impl<T> Serializer for Option<T>where
T: Serializer + ForyDefault,
fn fory_write( &self, context: &mut WriteContext<'_>, ref_mode: RefMode, write_type_info: bool, has_generics: bool, ) -> Result<(), Error>
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read( context: &mut ReadContext<'_>, ref_mode: RefMode, read_type_info: bool, ) -> Result<Option<T>, Error>
fn fory_read_with_type_info( context: &mut ReadContext<'_>, ref_mode: RefMode, type_info: Rc<TypeInfo>, ) -> Result<Option<T>, Error>
fn fory_read_data(context: &mut ReadContext<'_>) -> Result<Option<T>, Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(type_resolver: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn( &self, type_resolver: &TypeResolver, ) -> Result<TypeId, Error>
fn fory_is_option() -> bool
fn fory_is_none(&self) -> bool
fn fory_static_type_id() -> TypeId
fn fory_is_wrapper_type() -> bool
fn as_any(&self) -> &(dyn Any + 'static)
Source§impl<T> Serializer for Box<T>where
T: Serializer + ForyDefault,
impl<T> Serializer for Box<T>where
T: Serializer + ForyDefault,
fn fory_read_data(context: &mut ReadContext<'_>) -> Result<Box<T>, Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(type_resolver: &TypeResolver) -> Result<TypeId, Error>
fn fory_get_type_info( type_resolver: &TypeResolver, ) -> Result<Rc<TypeInfo>, Error>
fn fory_type_id_dyn( &self, type_resolver: &TypeResolver, ) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn fory_is_wrapper_type() -> bool
fn as_any(&self) -> &(dyn Any + 'static)
Source§impl<T> Serializer for BinaryHeap<T>
impl<T> Serializer for BinaryHeap<T>
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data(context: &mut ReadContext<'_>) -> Result<BinaryHeap<T>, Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn as_any(&self) -> &(dyn Any + 'static)
Source§impl<T> Serializer for BTreeSet<T>
impl<T> Serializer for BTreeSet<T>
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_write_data_generic( &self, context: &mut WriteContext<'_>, has_generics: bool, ) -> Result<(), Error>
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data(context: &mut ReadContext<'_>) -> Result<BTreeSet<T>, Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn as_any(&self) -> &(dyn Any + 'static)
Source§impl<T> Serializer for LinkedList<T>where
T: Serializer + ForyDefault,
impl<T> Serializer for LinkedList<T>where
T: Serializer + ForyDefault,
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_write_data_generic( &self, context: &mut WriteContext<'_>, has_generics: bool, ) -> Result<(), Error>
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data(context: &mut ReadContext<'_>) -> Result<LinkedList<T>, Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn as_any(&self) -> &(dyn Any + 'static)
Source§impl<T> Serializer for VecDeque<T>where
T: Serializer + ForyDefault,
impl<T> Serializer for VecDeque<T>where
T: Serializer + ForyDefault,
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_write_data_generic( &self, context: &mut WriteContext<'_>, has_generics: bool, ) -> Result<(), Error>
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data(context: &mut ReadContext<'_>) -> Result<VecDeque<T>, Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn as_any(&self) -> &(dyn Any + 'static)
Source§impl<T> Serializer for Rc<T>where
T: Serializer + ForyDefault + 'static,
impl<T> Serializer for Rc<T>where
T: Serializer + ForyDefault + 'static,
fn fory_write( &self, context: &mut WriteContext<'_>, ref_mode: RefMode, write_type_info: bool, has_generics: bool, ) -> Result<(), Error>
fn fory_write_data_generic( &self, context: &mut WriteContext<'_>, has_generics: bool, ) -> Result<(), Error>
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read( context: &mut ReadContext<'_>, ref_mode: RefMode, read_type_info: bool, ) -> Result<Rc<T>, Error>
fn fory_read_with_type_info( context: &mut ReadContext<'_>, ref_mode: RefMode, typeinfo: Rc<TypeInfo>, ) -> Result<Rc<T>, Error>
fn fory_read_data(context: &mut ReadContext<'_>) -> Result<Rc<T>, Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(type_resolver: &TypeResolver) -> Result<TypeId, Error>
fn fory_get_type_info( type_resolver: &TypeResolver, ) -> Result<Rc<TypeInfo>, Error>
fn fory_type_id_dyn( &self, type_resolver: &TypeResolver, ) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn as_any(&self) -> &(dyn Any + 'static)
Source§impl<T> Serializer for Arc<T>
impl<T> Serializer for Arc<T>
fn fory_write( &self, context: &mut WriteContext<'_>, ref_mode: RefMode, write_type_info: bool, has_generics: bool, ) -> Result<(), Error>
fn fory_write_data_generic( &self, context: &mut WriteContext<'_>, has_generics: bool, ) -> Result<(), Error>
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read( context: &mut ReadContext<'_>, ref_mode: RefMode, read_type_info: bool, ) -> Result<Arc<T>, Error>
fn fory_read_with_type_info( context: &mut ReadContext<'_>, ref_mode: RefMode, typeinfo: Rc<TypeInfo>, ) -> Result<Arc<T>, Error>
fn fory_read_data(context: &mut ReadContext<'_>) -> Result<Arc<T>, Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(type_resolver: &TypeResolver) -> Result<TypeId, Error>
fn fory_get_type_info( type_resolver: &TypeResolver, ) -> Result<Rc<TypeInfo>, Error>
fn fory_type_id_dyn( &self, type_resolver: &TypeResolver, ) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn as_any(&self) -> &(dyn Any + 'static)
Source§impl<T> Serializer for Vec<T>where
T: Serializer + ForyDefault,
impl<T> Serializer for Vec<T>where
T: Serializer + ForyDefault,
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_write_data_generic( &self, context: &mut WriteContext<'_>, has_generics: bool, ) -> Result<(), Error>
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data(context: &mut ReadContext<'_>) -> Result<Vec<T>, Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn as_any(&self) -> &(dyn Any + 'static)
Source§impl<T> Serializer for RefCell<T>where
T: Serializer + ForyDefault,
Serializer impl for RefCell<T>
impl<T> Serializer for RefCell<T>where
T: Serializer + ForyDefault,
Serializer impl for RefCell<T>
Simply delegates to the serializer for T, allowing interior mutable
containers to be included in serialized graphs.
fn fory_read( context: &mut ReadContext<'_>, ref_mode: RefMode, read_type_info: bool, ) -> Result<RefCell<T>, Error>
fn fory_read_with_type_info( context: &mut ReadContext<'_>, ref_mode: RefMode, type_info: Rc<TypeInfo>, ) -> Result<RefCell<T>, Error>
fn fory_read_data(context: &mut ReadContext<'_>) -> Result<RefCell<T>, Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
fn fory_write( &self, context: &mut WriteContext<'_>, ref_mode: RefMode, write_type_info: bool, has_generics: bool, ) -> Result<(), Error>
fn fory_write_data_generic( &self, context: &mut WriteContext<'_>, has_generics: bool, ) -> Result<(), Error>
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(type_resolver: &TypeResolver) -> Result<TypeId, Error>
fn fory_get_type_info( type_resolver: &TypeResolver, ) -> Result<Rc<TypeInfo>, Error>
fn fory_type_id_dyn( &self, type_resolver: &TypeResolver, ) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn fory_is_wrapper_type() -> bool
fn as_any(&self) -> &(dyn Any + 'static)
Source§impl<T> Serializer for PhantomData<T>where
T: 'static,
impl<T> Serializer for PhantomData<T>where
T: 'static,
fn fory_write_data(&self, _context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data( _context: &mut ReadContext<'_>, ) -> Result<PhantomData<T>, Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn as_any(&self) -> &(dyn Any + 'static)
Source§impl<T> Serializer for HashSet<T>
impl<T> Serializer for HashSet<T>
fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_write_data_generic( &self, context: &mut WriteContext<'_>, has_generics: bool, ) -> Result<(), Error>
fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>
fn fory_read_data(context: &mut ReadContext<'_>) -> Result<HashSet<T>, Error>
fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>
fn fory_reserved_space() -> usize
fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>
fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>
fn fory_static_type_id() -> TypeId
fn as_any(&self) -> &(dyn Any + 'static)
Source§impl<T> Serializer for Mutex<T>where
T: Serializer + ForyDefault,
Serializer impl for Mutex<T>
impl<T> Serializer for Mutex<T>where
T: Serializer + ForyDefault,
Serializer impl for Mutex<T>
Simply delegates to the serializer for T, allowing thread-safe interior mutable
containers to be included in serialized graphs.