Trait bf::traits::Interpretable [−][src]
pub trait Interpretable { fn interpret_state<R: Read, W: Write>(
&self,
state: State,
input: R,
output: W
) -> BfResult<()>; fn interpret<R: Read, W: Write>(
&self,
size: Option<usize>,
input: R,
output: W
) -> BfResult<()> { ... } fn interpret_stdin(&self, size: Option<usize>) -> BfResult<()> { ... } fn interpret_memory(
&self,
size: Option<usize>,
input: &[u8]
) -> BfResult<Vec<u8>> { ... } }
Program forms that can be interpreted.
Required Methods
fn interpret_state<R: Read, W: Write>(
&self,
state: State,
input: R,
output: W
) -> BfResult<()>
&self,
state: State,
input: R,
output: W
) -> BfResult<()>
Interprets a program against the given state.
Provided Methods
fn interpret<R: Read, W: Write>(
&self,
size: Option<usize>,
input: R,
output: W
) -> BfResult<()>
&self,
size: Option<usize>,
input: R,
output: W
) -> BfResult<()>
Interprets a program. If the given size
is None
, the default memory size.
fn interpret_stdin(&self, size: Option<usize>) -> BfResult<()>
Interprets a program using stdin and stdout for input and output.
fn interpret_memory(
&self,
size: Option<usize>,
input: &[u8]
) -> BfResult<Vec<u8>>
&self,
size: Option<usize>,
input: &[u8]
) -> BfResult<Vec<u8>>
Interprets a program from memory, returning a vector of its output.