Struct pmd_message::MessageBin[][src]

pub struct MessageBin { /* fields omitted */ }

A structure representing a translation (message) file in 3ds pokemon mystery dungeon games.

Each text have an associated (32bit, probably crc32) hash associated with them as a key.

Implementations

impl MessageBin[src]

pub fn messages(&self) -> &Vec<(u32, u32, String)>[src]

Return all the hash, the unk value and message content stored in the file

pub fn message_by_hash(&self, hash: u32) -> Option<&String>[src]

Return the message content with the given hash if it exist.

pub fn insert(&mut self, hash: u32, unk: u32, message: String)[src]

If the hash is already present, update the message content and unknown value, otherwise, add a new message at the end of the messages list. Return the old string if it exist.

pub fn load_file<T: Read + Seek>(
    file: &mut T
) -> Result<Self, MessageBinReadError>
[src]

Load a MessageBin file from the reader.

pub fn write<T: Seek + Write>(
    &self,
    file: &mut T
) -> Result<(), MessageBinWriteError>
[src]

Trait Implementations

impl Debug for MessageBin[src]

impl Default for MessageBin[src]

Auto Trait Implementations

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.