pub struct PakBuf { /* private fields */ }Expand description
Main serialization container for the .pak file format.
Implementations§
Source§impl PakBuf
impl PakBuf
pub fn animation_count(&self) -> usize
pub fn bitmap_count(&self) -> usize
pub fn bitmap_font_count(&self) -> usize
pub fn blob_count(&self) -> usize
pub fn from_stream(stream: impl Stream + 'static) -> Result<Self, Error>
pub fn keys(&self) -> impl Iterator<Item = &str>
pub fn validate_hash(&self) -> Result<bool, Error>
pub fn mesh_count(&self) -> usize
pub fn material_count(&self) -> usize
Sourcepub fn open(path: impl AsRef<Path>) -> Result<Self, Error>
pub fn open(path: impl AsRef<Path>) -> Result<Self, Error>
Opens the given path and decodes a Pak.
pub fn scene_count(&self) -> usize
Trait Implementations§
Source§impl Pak for PakBuf
impl Pak for PakBuf
Source§fn animation_id(&self, key: impl AsRef<str>) -> Option<AnimationId>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
fn read_scene_id(&mut self, id: impl Into<SceneId>) -> Result<Scene, Error>
Gets the corresponding animation for the given ID.