Skip to main content

Crate pagable

Crate pagable 

Source
Expand description

Pagable serialization framework.

The main traits for types to implement are:

  • PagableSerialize - implemented by types that can be serialized
  • PagableDeserialize - implemented by types that can be deserialized
  • PagableDeserializeOwned - implemented by types that can be deserialized from any lifetime
  • Pagable - a convenience trait combining both PagableSerialize and PagableDeserialize with Send + Sync + Debug

Implementations can use the derive macros #[derive(Pagable)] (which will derive both serialize and deserialize), #[derive(PagableSerialize)], and #[derive(PagableDeserialize)] for automatic implementations.

Re-exports§

pub use typetag::PagableRegisteredFor;
pub use typetag::PagableTagged;
pub use storage::data::DataKey;
pub use storage::data::OptionalDataKey;
pub use traits::Pagable;
pub use traits::PagableBoxDeserialize;
pub use traits::PagableCursor;
pub use traits::PagableDeserialize;
pub use traits::PagableDeserializeOwned;
pub use traits::PagableDeserializer;
pub use traits::PagableEagerDeserialize;
pub use traits::PagableEagerSerialize;
pub use traits::PagableSerialize;
pub use traits::PagableSerializer;
pub use traits::SessionContext;

Modules§

__internal
arc_erase
Type erasure traits for Arc serialization.
context
flavors
Custom postcard flavors for pagable serialization that expose position tracking and random access capabilities.
static_value
Pagable implementation for static values.
storage
testing
Testing utilities for pagable serialization.
traits
Core traits for pagable serialization and deserialization.
typetag
Pagable-native trait object serialization using inventory for auto-registration.

Macros§

anyhow
Construct an ad-hoc error from a string or existing non-anyhow error value.
declare_static_value_type
Declare a static value type for pagable serialization.
register_typetag
Register a concrete generic instantiation of a wrapper for pagable typetag dispatch. Each call emits the PagableRegisteredFor<dyn Trait> impl plus an inventory entry keyed by std::any::type_name. See PagableRegisteredFor for the full picture.
static_bytes
Create and register a StaticBytes constant.
static_str
Create and register a StaticStr constant.
static_value
Create and register a static value constant.
use_serde

Structs§

PagableArc
A reference-counted smart pointer that supports paging data to/from storage.
PinnedPagableArc
A reference-counted smart pointer that guarantees data is in memory.
PinnedPagableArcBorrow
A borrowed reference to pinned data, avoiding reference count manipulation.
StaticValue
A registered static value for pagable serialization/deserialization.

Type Aliases§

Error
Result
StaticBytes
StaticStr

Attribute Macros§

pagable_tagged
Attribute macro for pagable trait object serialization.
pagable_typetag

Derive Macros§

Pagable
PagableDeserialize
PagablePanic
Derives PagableSerialize and PagableDeserialize implementations that panic when called. Useful for types that need to satisfy trait bounds but should never actually be serialized/deserialized.
PagableSerialize