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.
impl EuvPakWriter
Serialization routines for EuvPakWriter.
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates an empty .euvpak archive builder.
§Returns
Self- EmptyEuvPakWriterready to collect entries and mip-tails.
Sourcepub fn add_entry(
&mut self,
path: &str,
bytes: &[u8],
kind: EuvPakEntryKind,
compress: bool,
) -> u64
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.
Sourcepub fn add_entry_hashed(
&mut self,
path_hash: u64,
bytes: &[u8],
kind: EuvPakEntryKind,
compress: bool,
) -> u64
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.
Sourcepub fn add_mip_tail(&mut self, path: &str, bytes: &[u8]) -> u64
pub fn add_mip_tail(&mut self, path: &str, bytes: &[u8]) -> u64
Sourcepub fn add_mip_tail_hashed(&mut self, path_hash: u64, bytes: &[u8]) -> u64
pub fn add_mip_tail_hashed(&mut self, path_hash: u64, bytes: &[u8]) -> u64
Sourcepub fn entry_count(&self) -> usize
pub fn entry_count(&self) -> usize
Returns the total number of queued entries including mip-tails.
§Returns
usize- Total queued archive entry count.
Trait Implementations§
Source§impl Clone for EuvPakWriter
impl Clone for EuvPakWriter
Source§impl Debug for EuvPakWriter
impl Debug for EuvPakWriter
Auto Trait Implementations§
impl Forget for EuvPakWriter
impl Freeze for EuvPakWriterwhere
*const u8 is !null: Freeze,
PhantomData<EuvPakPendingEntry>: Freeze,
PhantomData<(u64, Vec<u8>)>: Freeze,
impl Move for EuvPakWriter
impl RefUnwindSafe for EuvPakWriter
impl Send for EuvPakWriterwhere
RawVecInner: Send,
impl Sync for EuvPakWriterwhere
RawVecInner: Sync,
impl Unpin for EuvPakWriter
impl UnsafeUnpin for EuvPakWriterwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<EuvPakPendingEntry>: UnsafeUnpin,
PhantomData<(u64, Vec<u8>)>: UnsafeUnpin,
impl UnwindSafe for EuvPakWriterwhere
RawVecInner: UnwindSafe,
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
Mutably borrows from an owned value. Read more