pub trait GarnishRuntime<Data>where
Data: GarnishData,{
Show 56 methods
// Required methods
fn get_data(&self) -> &Data;
fn get_data_mut(&mut self) -> &mut Data;
fn apply<T>(
&mut self,
context: Option<&mut T>,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
where T: GarnishContext<Data>;
fn reapply(
&mut self,
index: <Data as GarnishData>::Size,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>;
fn empty_apply<T>(
&mut self,
context: Option<&mut T>,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
where T: GarnishContext<Data>;
fn add<T>(
&mut self,
context: Option<&mut T>,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
where T: GarnishContext<Data>;
fn subtract<T>(
&mut self,
context: Option<&mut T>,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
where T: GarnishContext<Data>;
fn multiply<T>(
&mut self,
context: Option<&mut T>,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
where T: GarnishContext<Data>;
fn power<T>(
&mut self,
context: Option<&mut T>,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
where T: GarnishContext<Data>;
fn divide<T>(
&mut self,
context: Option<&mut T>,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
where T: GarnishContext<Data>;
fn integer_divide<T>(
&mut self,
context: Option<&mut T>,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
where T: GarnishContext<Data>;
fn remainder<T>(
&mut self,
context: Option<&mut T>,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
where T: GarnishContext<Data>;
fn absolute_value<T>(
&mut self,
context: Option<&mut T>,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
where T: GarnishContext<Data>;
fn opposite<T>(
&mut self,
context: Option<&mut T>,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
where T: GarnishContext<Data>;
fn bitwise_not<T>(
&mut self,
context: Option<&mut T>,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
where T: GarnishContext<Data>;
fn bitwise_and<T>(
&mut self,
context: Option<&mut T>,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
where T: GarnishContext<Data>;
fn bitwise_or<T>(
&mut self,
context: Option<&mut T>,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
where T: GarnishContext<Data>;
fn bitwise_xor<T>(
&mut self,
context: Option<&mut T>,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
where T: GarnishContext<Data>;
fn bitwise_left_shift<T>(
&mut self,
context: Option<&mut T>,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
where T: GarnishContext<Data>;
fn bitwise_right_shift<T>(
&mut self,
context: Option<&mut T>,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
where T: GarnishContext<Data>;
fn and(
&mut self,
data: <Data as GarnishData>::Size,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>;
fn or(
&mut self,
data: <Data as GarnishData>::Size,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>;
fn xor(
&mut self,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>;
fn not(
&mut self,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>;
fn tis(
&mut self,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>;
fn type_of(
&mut self,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>;
fn type_equal(
&mut self,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>;
fn type_cast<T>(
&mut self,
context: Option<&mut T>,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
where T: GarnishContext<Data>;
fn equal(
&mut self,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>;
fn not_equal(
&mut self,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>;
fn less_than(
&mut self,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>;
fn less_than_or_equal(
&mut self,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>;
fn greater_than(
&mut self,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>;
fn greater_than_or_equal(
&mut self,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>;
fn jump(
&mut self,
index: <Data as GarnishData>::Size,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>;
fn jump_if_true(
&mut self,
index: <Data as GarnishData>::Size,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>;
fn jump_if_false(
&mut self,
index: <Data as GarnishData>::Size,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>;
fn end_expression(
&mut self,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>;
fn make_list(
&mut self,
len: <Data as GarnishData>::Size,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>;
fn access<T>(
&mut self,
context: Option<&mut T>,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
where T: GarnishContext<Data>;
fn access_left_internal<T>(
&mut self,
context: Option<&mut T>,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
where T: GarnishContext<Data>;
fn access_right_internal<T>(
&mut self,
context: Option<&mut T>,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
where T: GarnishContext<Data>;
fn access_length_internal<T>(
&mut self,
context: Option<&mut T>,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
where T: GarnishContext<Data>;
fn make_range(
&mut self,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>;
fn make_start_exclusive_range(
&mut self,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>;
fn make_end_exclusive_range(
&mut self,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>;
fn make_exclusive_range(
&mut self,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>;
fn make_pair(
&mut self,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>;
fn concat(
&mut self,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>;
fn put(
&mut self,
i: <Data as GarnishData>::Size,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>;
fn put_value(
&mut self,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>;
fn push_value(
&mut self,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>;
fn update_value(
&mut self,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>;
fn start_side_effect(
&mut self,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>;
fn end_side_effect(
&mut self,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>;
fn resolve<T>(
&mut self,
data: <Data as GarnishData>::Size,
context: Option<&mut T>,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
where T: GarnishContext<Data>;
}
Expand description
Trait containing instruction operations Garnish needs to execute.
All instruction methods (e.g. all except GarnishRuntime::get_data
, GarnishRuntime::get_data_mut
should a Result.
With the Ok value being the next instruction address to be executed if not sequential, otherwise return None
Required Methods§
fn get_data(&self) -> &Data
fn get_data_mut(&mut self) -> &mut Data
fn apply<T>(
&mut self,
context: Option<&mut T>,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>where
T: GarnishContext<Data>,
fn reapply( &mut self, index: <Data as GarnishData>::Size, ) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
fn empty_apply<T>(
&mut self,
context: Option<&mut T>,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>where
T: GarnishContext<Data>,
fn add<T>(
&mut self,
context: Option<&mut T>,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>where
T: GarnishContext<Data>,
fn subtract<T>(
&mut self,
context: Option<&mut T>,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>where
T: GarnishContext<Data>,
fn multiply<T>(
&mut self,
context: Option<&mut T>,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>where
T: GarnishContext<Data>,
fn power<T>(
&mut self,
context: Option<&mut T>,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>where
T: GarnishContext<Data>,
fn divide<T>(
&mut self,
context: Option<&mut T>,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>where
T: GarnishContext<Data>,
fn integer_divide<T>(
&mut self,
context: Option<&mut T>,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>where
T: GarnishContext<Data>,
fn remainder<T>(
&mut self,
context: Option<&mut T>,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>where
T: GarnishContext<Data>,
fn absolute_value<T>(
&mut self,
context: Option<&mut T>,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>where
T: GarnishContext<Data>,
fn opposite<T>(
&mut self,
context: Option<&mut T>,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>where
T: GarnishContext<Data>,
fn bitwise_not<T>(
&mut self,
context: Option<&mut T>,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>where
T: GarnishContext<Data>,
fn bitwise_and<T>(
&mut self,
context: Option<&mut T>,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>where
T: GarnishContext<Data>,
fn bitwise_or<T>(
&mut self,
context: Option<&mut T>,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>where
T: GarnishContext<Data>,
fn bitwise_xor<T>(
&mut self,
context: Option<&mut T>,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>where
T: GarnishContext<Data>,
fn bitwise_left_shift<T>(
&mut self,
context: Option<&mut T>,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>where
T: GarnishContext<Data>,
fn bitwise_right_shift<T>(
&mut self,
context: Option<&mut T>,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>where
T: GarnishContext<Data>,
fn and( &mut self, data: <Data as GarnishData>::Size, ) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
fn or( &mut self, data: <Data as GarnishData>::Size, ) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
fn xor( &mut self, ) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
fn not( &mut self, ) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
fn tis( &mut self, ) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
fn type_of( &mut self, ) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
fn type_equal( &mut self, ) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
fn type_cast<T>(
&mut self,
context: Option<&mut T>,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>where
T: GarnishContext<Data>,
fn equal( &mut self, ) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
fn not_equal( &mut self, ) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
fn less_than( &mut self, ) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
fn less_than_or_equal( &mut self, ) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
fn greater_than( &mut self, ) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
fn greater_than_or_equal( &mut self, ) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
fn jump( &mut self, index: <Data as GarnishData>::Size, ) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
fn jump_if_true( &mut self, index: <Data as GarnishData>::Size, ) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
fn jump_if_false( &mut self, index: <Data as GarnishData>::Size, ) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
fn end_expression( &mut self, ) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
fn make_list( &mut self, len: <Data as GarnishData>::Size, ) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
fn access<T>(
&mut self,
context: Option<&mut T>,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>where
T: GarnishContext<Data>,
fn access_left_internal<T>(
&mut self,
context: Option<&mut T>,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>where
T: GarnishContext<Data>,
fn access_right_internal<T>(
&mut self,
context: Option<&mut T>,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>where
T: GarnishContext<Data>,
fn access_length_internal<T>(
&mut self,
context: Option<&mut T>,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>where
T: GarnishContext<Data>,
fn make_range( &mut self, ) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
fn make_start_exclusive_range( &mut self, ) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
fn make_end_exclusive_range( &mut self, ) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
fn make_exclusive_range( &mut self, ) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
fn make_pair( &mut self, ) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
fn concat( &mut self, ) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
fn put( &mut self, i: <Data as GarnishData>::Size, ) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
fn put_value( &mut self, ) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
fn push_value( &mut self, ) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
fn update_value( &mut self, ) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
fn start_side_effect( &mut self, ) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
fn end_side_effect( &mut self, ) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>
fn resolve<T>(
&mut self,
data: <Data as GarnishData>::Size,
context: Option<&mut T>,
) -> Result<Option<<Data as GarnishData>::Size>, RuntimeError<<Data as GarnishData>::Error>>where
T: GarnishContext<Data>,
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.