Struct bf::state::State[][src]

pub struct State { /* fields omitted */ }

The Brainfuck machine state.

Methods

impl State
[src]

Creates a new BF machine state with memory capacity DEFAULT_CAPACITY (30_000).

Creates a new BF machine state with the given memory capacity.

Decrements/decreases the pointer.

Errors

Return Err if pointer would go below 0.

Increments/increases the pointer.

Errors

Return Err if pointer would go past the end of the memory.

Increments/increases the byte at the pointer.

Wraps around modulo 256.

Decrements/decreases the byte at the pointer.

Wraps around modulo 256.

Gets the value of the byte at the pointer.

Sets the value of the byte at the pointer.

Adds the given value at the given positive offset from the pointer.

Adds the given value at the given negative offset from the pointer.

Reads from a Read into the byte at the pointer.

Writes to a Write from the byte at the pointer.

The memory capacity.

Gets a mutable, raw pointer to the start of memory.

This is used by the JIT RTS to pass the memory pointer to the generated code.

Trait Implementations

impl Clone for State
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for State
[src]

Formats the value using the given formatter. Read more

impl Eq for State
[src]

impl PartialEq for State
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Default for State
[src]

Returns the "default value" for a type. Read more

Auto Trait Implementations

impl Send for State

impl Sync for State