Skip to main content

PakBuf

Struct PakBuf 

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

Main serialization container for the .pak file format.

Implementations§

Source§

impl PakBuf

Source

pub fn animation_count(&self) -> usize

Source

pub fn bitmap_count(&self) -> usize

Source

pub fn bitmap_font_count(&self) -> usize

Source

pub fn blob_count(&self) -> usize

Source

pub fn from_stream(stream: impl Stream + 'static) -> Result<Self, Error>

Source

pub fn keys(&self) -> impl Iterator<Item = &str>

Source

pub fn validate_hash(&self) -> Result<bool, Error>

Source

pub fn mesh_count(&self) -> usize

Source

pub fn material_count(&self) -> usize

Source

pub fn open(path: impl AsRef<Path>) -> Result<Self, Error>

Opens the given path and decodes a Pak.

Source

pub fn scene_count(&self) -> usize

Trait Implementations§

Source§

impl Debug for PakBuf

Source§

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

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

impl From<&'static [u8]> for PakBuf

Source§

fn from(data: &'static [u8]) -> Self

Converts to this type from the input type.
Source§

impl Pak for PakBuf

Source§

fn animation_id(&self, key: impl AsRef<str>) -> Option<AnimationId>

Gets the pak-unique AnimationId corresponding to the given key, if one exists.

Source§

fn bitmap_font_id(&self, key: impl AsRef<str>) -> Option<BitmapFontId>

Gets the pak-unique BitmapFontId corresponding to the given key, if one exists.

Source§

fn bitmap_id(&self, key: impl AsRef<str>) -> Option<BitmapId>

Gets the pak-unique BitmapId corresponding to the given key, if one exists.

Source§

fn blob_id(&self, key: impl AsRef<str>) -> Option<BlobId>

Gets the pak-unique BlobId corresponding to the given key, if one exists.

Source§

fn material_id(&self, key: impl AsRef<str>) -> Option<MaterialId>

Gets the pak-unique MaterialId corresponding to the given key, if one exists.

Source§

fn mesh_id(&self, key: impl AsRef<str>) -> Option<MeshId>

Gets the pak-unique MeshId corresponding to the given key, if one exists.

Source§

fn scene_id(&self, key: impl AsRef<str>) -> Option<SceneId>

Gets the pak-unique SceneId corresponding to the given key, if one exists.

Source§

fn read_animation_id( &mut self, id: impl Into<AnimationId>, ) -> Result<Animation, Error>

Gets the corresponding animation for the given ID.

Source§

fn read_bitmap_font_id( &mut self, id: impl Into<BitmapFontId>, ) -> Result<BitmapFont, Error>

Reads the corresponding bitmap for the given ID.

Source§

fn read_bitmap_id(&mut self, id: impl Into<BitmapId>) -> Result<Bitmap, Error>

Reads the corresponding bitmap for the given ID.

Source§

fn read_blob_id(&mut self, id: impl Into<BlobId>) -> Result<Vec<u8>, Error>

Gets the corresponding blob for the given ID.

Source§

fn read_material_id(&self, id: impl Into<MaterialId>) -> Option<MaterialInfo>

Gets the material for the given ID.

Source§

fn read_mesh_id(&mut self, id: impl Into<MeshId>) -> Result<Mesh, Error>

Gets the corresponding mesh for the given ID.

Source§

fn read_scene_id(&mut self, id: impl Into<SceneId>) -> Result<Scene, Error>

Gets the corresponding animation for the given ID.

Source§

fn read_material(&self, key: impl AsRef<str>) -> Option<MaterialInfo>

Gets the material corresponding to the given key, if one exists.
Source§

fn read_animation(&mut self, key: impl AsRef<str>) -> Result<Animation, Error>

Source§

fn read_bitmap_font( &mut self, key: impl AsRef<str>, ) -> Result<BitmapFont, Error>

Source§

fn read_bitmap(&mut self, key: impl AsRef<str>) -> Result<Bitmap, Error>

Source§

fn read_blob(&mut self, key: impl AsRef<str>) -> Result<Vec<u8>, Error>

Source§

fn read_mesh(&mut self, key: impl AsRef<str>) -> Result<Mesh, Error>

Source§

fn read_scene(&mut self, key: impl AsRef<str>) -> Result<Scene, Error>

Auto Trait Implementations§

§

impl !RefUnwindSafe for PakBuf

§

impl !Sync for PakBuf

§

impl !UnwindSafe for PakBuf

§

impl Freeze for PakBuf

§

impl Send for PakBuf

§

impl Unpin for PakBuf

§

impl UnsafeUnpin for PakBuf

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, 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.