DataSpace

Struct DataSpace 

Source
pub struct DataSpace {
    pub inner: *mut u8,
    /* private fields */
}

Fields§

§inner: *mut u8

Implementations§

Source§

impl DataSpace

Source

pub fn new(num_pages: usize) -> Self

Examples found in repository?
examples/vm.rs (line 101)
85    pub fn new(data_pages: usize) -> VM {
86        let mut labels = Vec::with_capacity(LABEL_COUNT as _);
87        labels.resize(LABEL_COUNT as _, 0);
88        let mut vm = VM {
89            current_task: 0,
90            tasks: [
91                // Only operator task has its own input buffer.
92                Task::new_terminal(),
93                Task::new_background(),
94                Task::new_background(),
95                Task::new_background(),
96                Task::new_background(),
97            ],
98            last_error: None,
99            handler: 0,
100            wordlist: Wordlist::with_capacity(1000),
101            data_space: DataSpace::new(data_pages),
102            tkn: Some(String::with_capacity(64)),
103            outbuf: Some(String::with_capacity(128)),
104            hldbuf: String::with_capacity(128),
105            references: ForwardReferences::new(),
106            now: Instant::now(),
107            forward_bitset: BitSet::with_capacity(LABEL_COUNT),
108            resolved_bitset: BitSet::with_capacity(LABEL_COUNT),
109            labels,
110        };
111        vm.add_core();
112        vm.add_output();
113        vm.add_tools();
114        vm.add_environment();
115        vm.add_facility();
116        vm.add_float();
117        vm.add_units();
118        vm.add_file_access();
119        vm.add_loader();
120
121        vm.load_core_fth();
122
123        vm
124    }
Source

pub fn with_capacity(cap: usize) -> Self

Source

pub fn system_variables(&self) -> &SystemVariables

Source

pub fn system_variables_mut(&mut self) -> &mut SystemVariables

Trait Implementations§

Source§

impl Drop for DataSpace

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.