Skip to main content

EuvPakWriter

Struct EuvPakWriter 

Source
pub struct EuvPakWriter { /* private fields */ }
Expand description

Builder serializing virtual assets and contiguous mip-tail superblocks into a 64-byte-aligned .euvpak archive.

Implementations§

Source§

impl EuvPakWriter

Serialization routines for EuvPakWriter.

Source

pub fn new() -> Self

Creates an empty .euvpak archive builder.

§Returns
  • Self - Empty EuvPakWriter ready to collect entries and mip-tails.
Source

pub fn add_entry( &mut self, path: &str, bytes: &[u8], kind: EuvPakEntryKind, compress: bool, ) -> u64

Appends a virtual asset entry to the archive and returns its 64-bit FNV-1a path hash.

§Arguments
  • &str - Virtual asset path inside the archive.
  • &[u8] - Uncompressed asset payload bytes.
  • EuvPakEntryKind - Typed asset category.
  • bool - Whether LZ4 block compression is requested for this payload.
§Returns
  • u64 - Normalized 64-bit FNV-1a path hash for O(1) lookup.
Source

pub fn add_entry_hashed( &mut self, path_hash: u64, bytes: &[u8], kind: EuvPakEntryKind, compress: bool, ) -> u64

Appends a virtual asset entry by precomputed 64-bit path hash.

§Arguments
  • u64 - Precomputed 64-bit FNV-1a virtual path hash.
  • &[u8] - Uncompressed asset payload bytes.
  • EuvPakEntryKind - Typed asset category.
  • bool - Whether LZ4 block compression is requested for this payload.
§Returns
  • u64 - Stored 64-bit path hash.
Source

pub fn add_mip_tail(&mut self, path: &str, bytes: &[u8]) -> u64

Appends a low-resolution texture mip-tail payload into the contiguous Mip-Tail Superblock.

§Arguments
  • &str - Virtual asset path identifying the texture mip-tail.
  • &[u8] - Packed 16x16/32x32 mip-tail bytes.
§Returns
  • u64 - Normalized 64-bit FNV-1a path hash for O(1) lookup.
Source

pub fn add_mip_tail_hashed(&mut self, path_hash: u64, bytes: &[u8]) -> u64

Appends a low-resolution texture mip-tail payload by precomputed 64-bit path hash.

§Arguments
  • u64 - Precomputed 64-bit FNV-1a virtual path hash.
  • &[u8] - Packed 16x16/32x32 mip-tail bytes.
§Returns
  • u64 - Stored 64-bit path hash.
Source

pub fn entry_count(&self) -> usize

Returns the total number of queued entries including mip-tails.

§Returns
  • usize - Total queued archive entry count.
Source

pub fn finish_bytes(&self) -> Result<Vec<u8>, String>

Finalizes and serializes all queued entries into a 64-byte-aligned .euvpak binary buffer with an open-addressed FNV-1a TOC and CRC32 integrity checksums.

§Returns
  • Result<Vec<u8>, String> - Complete .euvpak binary archive bytes.

Trait Implementations§

Source§

impl Clone for EuvPakWriter

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EuvPakWriter

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for EuvPakWriter

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Forget for EuvPakWriter

§

impl Freeze for EuvPakWriter
where *const u8 is !null: Freeze, PhantomData<EuvPakPendingEntry>: Freeze, PhantomData<(u64, Vec<u8>)>: Freeze,

§

impl Move for EuvPakWriter

§

impl RefUnwindSafe for EuvPakWriter

§

impl Send for EuvPakWriter
where RawVecInner: Send,

§

impl Sync for EuvPakWriter
where RawVecInner: Sync,

§

impl Unpin for EuvPakWriter
where *const u8 is !null: Unpin,

§

impl UnsafeUnpin for EuvPakWriter
where *const u8 is !null: UnsafeUnpin, PhantomData<EuvPakPendingEntry>: UnsafeUnpin, PhantomData<(u64, Vec<u8>)>: UnsafeUnpin,

§

impl UnwindSafe for EuvPakWriter
where RawVecInner: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.