[][src]Struct melon::Program

pub struct Program { /* fields omitted */ }

The container for a program

You can load a Program from a file or create one using the ProgramBuilder

Methods

impl Program[src]

pub fn from_file<P: AsRef<Path>>(path: P) -> Result<Program>[src]

Loads a MsgPack encoded and gzipped melon image from the given file

pub fn from_slice(vec: &[u8]) -> Result<Program>[src]

Decodes a program from MsgPack encoded and gzipped image data

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

Encodes the program as MsgPack encoded and gzipped image data

pub fn save_as<P: AsRef<Path>>(&self, path: P) -> Result<()>[src]

Saves the program as a MsgPack encoded and gzipped image to the given file

pub fn target_version(&self) -> &Version[src]

The target version of the melon API the program was compiled against

pub fn system_id(&self) -> &String[src]

The ID of the System the program is compiled against

pub fn instructions(&self) -> &Vec<Instruction>[src]

The instuctions of the program

pub fn mem_pages(&self) -> Option<u8>[src]

(Optional) The minimum number of allocated memory pages (1 page = 1024 Byte)

pub fn entry_point(&self) -> Address[src]

The entry address of the program

Trait Implementations

impl Clone for Program[src]

impl Debug for Program[src]

impl<'de> Deserialize<'de> for Program[src]

impl Serialize for Program[src]

Auto Trait Implementations

impl RefUnwindSafe for Program

impl Send for Program

impl Sync for Program

impl Unpin for Program

impl UnwindSafe for Program

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,