pub struct WriteContext<'a> {
pub writer: Writer<'a>,
pub ref_writer: RefWriter,
/* private fields */
}Expand description
Serialization state container used on a single thread at a time. Sharing the same instance across threads simultaneously causes undefined behavior.
Fields§
§writer: Writer<'a>§ref_writer: RefWriterImplementations§
Source§impl<'a> WriteContext<'a>
impl<'a> WriteContext<'a>
pub fn new(type_resolver: TypeResolver, config: Config) -> WriteContext<'a>
pub fn attach_writer(&mut self, writer: Writer<'a>)
pub fn detach_writer(&mut self)
Sourcepub fn get_type_resolver(&self) -> &TypeResolver
pub fn get_type_resolver(&self) -> &TypeResolver
Get type resolver
pub fn get_type_info(&self, type_id: &TypeId) -> Result<Rc<TypeInfo>, Error>
Sourcepub fn is_compatible(&self) -> bool
pub fn is_compatible(&self) -> bool
Check if compatible mode is enabled
Check if meta sharing is enabled
Sourcepub fn is_compress_string(&self) -> bool
pub fn is_compress_string(&self) -> bool
Check if string compression is enabled
Sourcepub fn is_check_struct_version(&self) -> bool
pub fn is_check_struct_version(&self) -> bool
Check if class version checking is enabled
Sourcepub fn is_track_ref(&self) -> bool
pub fn is_track_ref(&self) -> bool
Check if reference tracking is enabled
Sourcepub fn write_type_meta(&mut self, type_id: TypeId) -> Result<(), Error>
pub fn write_type_meta(&mut self, type_id: TypeId) -> Result<(), Error>
Write type meta inline using streaming protocol. Writes index marker with LSB indicating new type or reference.
pub fn write_any_type_info( &mut self, fory_type_id: u32, concrete_type_id: TypeId, ) -> Result<Rc<TypeInfo>, Error>
pub fn write_meta_string_bytes( &mut self, ms: Rc<MetaString>, ) -> Result<(), Error>
pub fn reset(&mut self)
Trait Implementations§
Source§impl<'a> Drop for WriteContext<'a>
impl<'a> Drop for WriteContext<'a>
impl<'a> Send for WriteContext<'a>
impl<'a> Sync for WriteContext<'a>
Auto Trait Implementations§
impl<'a> Freeze for WriteContext<'a>
impl<'a> RefUnwindSafe for WriteContext<'a>
impl<'a> Unpin for WriteContext<'a>
impl<'a> !UnwindSafe for WriteContext<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more