Struct CPack

Source
pub struct CPack<F: Read + Seek> { /* private fields */ }
Expand description

A structure that represent a cpack file, used in pokemon mystery dungeon games

Those cpack file are archive that may contain multiple file, each file being identified by an id representing it’s order of position in the file.

Implementations§

Source§

impl<F: Read + Seek> CPack<F>

Source

pub fn new_from_file(file: F) -> Result<CPack<F>, CPackError>

Create a CPack struct from a cpack file

Source

pub fn len(&self) -> usize

Return the number of file in the cpack archive

Source

pub fn is_empty(&self) -> bool

Return true if the cpack archive is empty

Source

pub fn get_file(&self, id: usize) -> Result<PartitionMutex<F>, CPackError>

get the file by an id, and return it as PartitionMutex. panic if it doesn’t exist

Trait Implementations§

Source§

impl<F: Debug + Read + Seek> Debug for CPack<F>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<F> Freeze for CPack<F>

§

impl<F> RefUnwindSafe for CPack<F>

§

impl<F> Send for CPack<F>
where F: Send,

§

impl<F> Sync for CPack<F>
where F: Send,

§

impl<F> Unpin for CPack<F>

§

impl<F> UnwindSafe for CPack<F>

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.