pub struct Serializer3DF32<'a> { /* private fields */ }f32-storage only.Expand description
Serialization builder for Index3DF32, created by
Index3DF32::serialize. Writes f32 box records plus an optional per-item
payload and descriptive metadata; the f32-box counterpart of
Serializer3D.
Implementations§
Source§impl<'a> Serializer3DF32<'a>
impl<'a> Serializer3DF32<'a>
Sourcepub fn payloads<P: AsRef<[u8]>>(self, payloads: &'a [P]) -> Self
pub fn payloads<P: AsRef<[u8]>>(self, payloads: &'a [P]) -> Self
Attach one opaque payload blob per item, in item order.
Sourcepub fn interleaved(self) -> Self
Available on crate feature stream only.
pub fn interleaved(self) -> Self
stream only.Use the streaming-tuned interleaved node layout (box and index adjacent
per node), so StreamIndex3DF32 fetches each
level in one coalesced read instead of two. Same file size.
Sourcepub fn records(self, stride: usize, flat: &'a [u8]) -> Self
pub fn records(self, stride: usize, flat: &'a [u8]) -> Self
Attach a fixed-width payload: flat is num_items * stride bytes (one
stride-byte record per item). See
Serializer3D::records.
Sourcepub fn triangles<T: Triangle3>(self, triangles: &'a [T]) -> Self
pub fn triangles<T: Triangle3>(self, triangles: &'a [T]) -> Self
Attach a fixed-width triangle payload, one per item. A compact mesh BVH
that streams through StreamIndex3DF32.
Sourcepub fn crs(self, crs: &'a str) -> Self
pub fn crs(self, crs: &'a str) -> Self
Set the coordinate reference system identifier (opaque, e.g. "EPSG:4979").
Sourcepub fn content_type(self, content_type: &'a str) -> Self
pub fn content_type(self, content_type: &'a str) -> Self
Set the payload content type / media type.
Sourcepub fn attribution(self, attribution: &'a str) -> Self
pub fn attribution(self, attribution: &'a str) -> Self
Set an attribution / license string.
Sourcepub fn payload_prefix_len(self, len: u32) -> Self
pub fn payload_prefix_len(self, len: u32) -> Self
Also write a payload-prefix section: a contiguous, leaf-rank-indexed
copy of the first len bytes of every payload blob.
Queries that need only a fixed-size head of each payload — an id, a key,
a record header — otherwise read those bytes where they lie, strided
through variable-length bodies, which cannot coalesce and costs one range
read per match. A dense copy collapses that to a handful of runs, for
len extra bytes per item on disk. Worth it when bodies are much larger
than len and the reader is remote; pointless otherwise.
Requires payloads; ignored for a fixed-width payload
whose whole record is already the prefix.
Sourcepub fn to_bytes_into(self, out: &mut Vec<u8>) -> Result<(), PayloadError>
pub fn to_bytes_into(self, out: &mut Vec<u8>) -> Result<(), PayloadError>
Serialize into a reused buffer (cleared first).
Auto Trait Implementations§
impl<'a> Freeze for Serializer3DF32<'a>
impl<'a> RefUnwindSafe for Serializer3DF32<'a>
impl<'a> Send for Serializer3DF32<'a>
impl<'a> Sync for Serializer3DF32<'a>
impl<'a> Unpin for Serializer3DF32<'a>
impl<'a> UnsafeUnpin for Serializer3DF32<'a>
impl<'a> UnwindSafe for Serializer3DF32<'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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more