[][src]Struct rpak::PakArchive

pub struct PakArchive<'a> {
    pub files: Vec<(String, &'a [u8])>,
}

An in-memory representation of a PAK archive

Fields

files: Vec<(String, &'a [u8])>

Files contained within this archive

Implementations

impl<'a> PakArchive<'a>[src]

pub fn new() -> Self[src]

Create a new empty PAK archive.

pub fn add_file(&mut self, file_name: String, file_data: &'a [u8])[src]

Add a file to the archive with the given file name, containing the given data.

pub fn from_bytes(data: &'a [u8]) -> Result<Self, ()>[src]

Decode a PAK archive from an input byte slice.

Returns Err(()) if the PAK file header was invalid.

pub fn as_bytes(&self) -> Vec<u8>[src]

Encode this archive representation into a byte vector.

Auto Trait Implementations

impl<'a> RefUnwindSafe for PakArchive<'a>

impl<'a> Send for PakArchive<'a>

impl<'a> Sync for PakArchive<'a>

impl<'a> Unpin for PakArchive<'a>

impl<'a> UnwindSafe for PakArchive<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.