Struct strontium::memory::Memory

source ·
pub struct Memory {
    pub data: Vec<bool>,
}
Expand description

A generic, very low-level structure for data and code storage. It has no concept of numbers or strings. Instead, it manipulates an array of bits. The basic operations can be used to store numbers or strings, compose methods like addition, multiplication, etc. This makes the module really versatile.

Fields

data: Vec<bool>

Implementations

Create a new memory instance

Load a memory snapshot and drop the content from before

Add a vector of bits to the container

Return the contents of the container

Set the given bit to 1

Set the given bit to 0

Grow the container by (n) bits

Shrink the container by (n) bits

Perform a bitwise AND operation on a single bit

Perform a bitwise OR operation on a single bit

Perform a bitwise exclusive OR operation on a single bit

Perform a bitwise negation on a single bit

Perform a bitwise AND operation on a range of bits

Perform a bitwise OR operation on a range of bits

Perform a bitwise exclusive OR operation on a range of bits

Perform an arithmetic (sign-preserving) right-shift on a range of bits and write the result to another range

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.