pub struct OptimizedRkyv { /* private fields */ }Expand description
Optimized RKYV serializer with intelligent strategy selection
Implementations§
Source§impl OptimizedRkyv
impl OptimizedRkyv
Sourcepub fn serialize_to_file<T>(&self, value: &T, path: &Path) -> Result<(), Error>
pub fn serialize_to_file<T>(&self, value: &T, path: &Path) -> Result<(), Error>
Serialize to file with intelligent I/O strategy
- Small files (<1KB): Uses std::fs (faster, less overhead)
- Large files (≥1KB): Uses the configured file I/O backend
Sourcepub fn deserialize_from_file<T>(&self, path: &Path) -> Result<T, Error>where
T: Archive,
T::Archived: for<'a> CheckBytes<HighValidator<'a, Error>> + RkyvDeserialize<T, Strategy<Pool, Error>>,
pub fn deserialize_from_file<T>(&self, path: &Path) -> Result<T, Error>where
T: Archive,
T::Archived: for<'a> CheckBytes<HighValidator<'a, Error>> + RkyvDeserialize<T, Strategy<Pool, Error>>,
Deserialize from file with intelligent I/O strategy
Sourcepub fn serialize_batch_smart<T>(
&self,
items: &[T],
) -> Result<Vec<AlignedVec>, Error>where
T: for<'a> RkyvSerialize<Strategy<Serializer<AlignedVec, ArenaHandle<'a>, Share>, Error>> + Sync,
pub fn serialize_batch_smart<T>(
&self,
items: &[T],
) -> Result<Vec<AlignedVec>, Error>where
T: for<'a> RkyvSerialize<Strategy<Serializer<AlignedVec, ArenaHandle<'a>, Share>, Error>> + Sync,
Batch serialize with intelligent strategy selection
- Small batches (<10k): Sequential with pre-allocation (8-15% faster)
- Large batches (≥10k): Parallel processing (scales with cores)
Sourcepub fn serialize_batch_to_files<T>(
&self,
items: &[(T, &Path)],
) -> Result<Vec<Result<()>>, Error>
pub fn serialize_batch_to_files<T>( &self, items: &[(T, &Path)], ) -> Result<Vec<Result<()>>, Error>
Batch file operations with platform-optimized I/O
Sourcepub fn deserialize_batch_from_files<T>(
&self,
paths: &[&Path],
) -> Result<Vec<Result<T, Error>>, Error>where
T: Archive,
T::Archived: for<'a> CheckBytes<HighValidator<'a, Error>> + RkyvDeserialize<T, Strategy<Pool, Error>>,
pub fn deserialize_batch_from_files<T>(
&self,
paths: &[&Path],
) -> Result<Vec<Result<T, Error>>, Error>where
T: Archive,
T::Archived: for<'a> CheckBytes<HighValidator<'a, Error>> + RkyvDeserialize<T, Strategy<Pool, Error>>,
Batch read with platform-optimized I/O
Sourcepub fn backend_name(&self) -> &'static str
pub fn backend_name(&self) -> &'static str
Get the I/O backend name
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OptimizedRkyv
impl RefUnwindSafe for OptimizedRkyv
impl Send for OptimizedRkyv
impl Sync for OptimizedRkyv
impl Unpin for OptimizedRkyv
impl UnsafeUnpin for OptimizedRkyv
impl UnwindSafe for OptimizedRkyv
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Returns whether the given value has been niched. Read more
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
Writes data to
out indicating that a T is niched.