pub trait TypedBody:
Any
+ Send
+ Debug {
// Required methods
fn words(&self) -> usize;
fn serialize_into(&self, dst: &mut [u64]);
fn as_any(&self) -> &dyn Any;
fn into_any(self: Box<Self>) -> Box<dyn Any>;
}pool only.Expand description
A chunk body the pool holds in its owner’s in-memory form, serializing it
only when it has to leave that form: on eviction, on backing, and on a
copy-out read. Under budget a typed chunk therefore costs the pool its
bookkeeping and nothing else, and ChunkHandle::take_typed hands the
body back without a copy.
The body is immutable once inserted. Spill threads serialize and drop it
under the chunk’s state lock, so it must be Send.
Required Methods§
Sourcefn words(&self) -> usize
fn words(&self) -> usize
The serialized length in u64 words. Must not change while the pool
holds the body.
Sourcefn serialize_into(&self, dst: &mut [u64])
fn serialize_into(&self, dst: &mut [u64])
Writes the serialized form into dst, which is exactly
TypedBody::words long, overwriting all of it.
Sourcefn as_any(&self) -> &dyn Any
fn as_any(&self) -> &dyn Any
The body as std::any::Any, for the owner to downcast a borrow.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".