Skip to main content

Serializer3DF32

Struct Serializer3DF32 

Source
pub struct Serializer3DF32<'a> { /* private fields */ }
Available on crate feature 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>

Source

pub fn payloads<P: AsRef<[u8]>>(self, payloads: &'a [P]) -> Self

Attach one opaque payload blob per item, in item order.

Source

pub fn interleaved(self) -> Self

Available on crate feature 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.

Source

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.

Source

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.

Source

pub fn crs(self, crs: &'a str) -> Self

Set the coordinate reference system identifier (opaque, e.g. "EPSG:4979").

Source

pub fn content_type(self, content_type: &'a str) -> Self

Set the payload content type / media type.

Source

pub fn attribution(self, attribution: &'a str) -> Self

Set an attribution / license string.

Source

pub fn to_bytes(self) -> Result<Vec<u8>, PayloadError>

Serialize into a new buffer.

Source

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.

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.