pub trait State {
type Error;
Show 24 methods
// Required methods
fn ask_question(&mut self, question: SValue) -> Result<(), Self::Error>;
fn last_answer(&mut self) -> Result<&str, Self::Error>;
fn request_float_random(
&mut self,
range: RangeInclusive<f64>,
) -> Result<f64, Self::Error>;
fn request_int_random(
&mut self,
range: RangeInclusive<i64>,
) -> Result<i64, Self::Error>;
fn data_set_variable(
&mut self,
var_id: &Variable,
value: SValue,
) -> Result<(), Self::Error>;
fn data_read_variable(
&mut self,
var_id: &Variable,
) -> Result<&SValue, Self::Error>;
fn write_output(&mut self, output_kind: OutputKind, message: SValue);
fn data_list_contains_item(
&mut self,
list_id: &List,
item: &SValue,
) -> Result<bool, Self::Error>;
fn data_read_textual_list_repr(
&mut self,
list_id: &List,
) -> Result<SValue, Self::Error>;
fn data_append_to_list(
&mut self,
list_id: &List,
item: SValue,
) -> Result<(), Self::Error>;
fn data_item_of_list(
&mut self,
list_id: &List,
one_based_index: &SValue,
) -> Result<SValue, Self::Error>;
fn data_item_num_of_list(
&mut self,
list_id: &List,
item: &SValue,
) -> Result<i64, Self::Error>;
fn data_length_of_list(
&mut self,
list_id: &List,
) -> Result<i64, Self::Error>;
fn data_delete_of_list(
&mut self,
list_id: &List,
one_based_index: &SValue,
) -> Result<(), Self::Error>;
fn data_delete_all_of_list(
&mut self,
list_id: &List,
) -> Result<(), Self::Error>;
fn data_insert_at_list(
&mut self,
list_id: &List,
one_based_index: &SValue,
item: SValue,
) -> Result<(), Self::Error>;
fn data_replace_list_at(
&mut self,
list_id: &List,
one_based_index: &SValue,
item: SValue,
) -> Result<(), Self::Error>;
// Provided methods
fn set_statement_as_context(&mut self, _id: &Id) -> Result<(), Self::Error> { ... }
fn request_random(
&mut self,
range: RangeInclusive<SNumber>,
) -> Result<SNumber, Self::Error> { ... }
fn data_change_variable_by(
&mut self,
var_id: &Variable,
by: SValue,
) -> Result<(), Self::Error> { ... }
fn wait_for_secs(&mut self, _secs: SNumber) -> Result<(), Self::Error> { ... }
fn notice_event_block_executed(
&mut self,
_event: &EventBlockKind,
_block: &ARc<BlockWrapper>,
) -> Result<(), Self::Error> { ... }
fn notice_proc_def_block_executed(
&mut self,
_def: &ProceduresDefinition,
_block: &ARc<BlockWrapper>,
) -> Result<(), Self::Error> { ... }
fn notice_proc_proto_block_executed(
&mut self,
_proto: &ProceduresPrototype,
_block: &ARc<BlockWrapper>,
) -> Result<(), Self::Error> { ... }
}Required Associated Types§
Required Methods§
fn ask_question(&mut self, question: SValue) -> Result<(), Self::Error>
fn last_answer(&mut self) -> Result<&str, Self::Error>
fn request_float_random( &mut self, range: RangeInclusive<f64>, ) -> Result<f64, Self::Error>
fn request_int_random( &mut self, range: RangeInclusive<i64>, ) -> Result<i64, Self::Error>
fn data_set_variable( &mut self, var_id: &Variable, value: SValue, ) -> Result<(), Self::Error>
fn data_read_variable( &mut self, var_id: &Variable, ) -> Result<&SValue, Self::Error>
fn write_output(&mut self, output_kind: OutputKind, message: SValue)
fn data_list_contains_item( &mut self, list_id: &List, item: &SValue, ) -> Result<bool, Self::Error>
fn data_read_textual_list_repr( &mut self, list_id: &List, ) -> Result<SValue, Self::Error>
fn data_append_to_list( &mut self, list_id: &List, item: SValue, ) -> Result<(), Self::Error>
fn data_item_of_list( &mut self, list_id: &List, one_based_index: &SValue, ) -> Result<SValue, Self::Error>
fn data_item_num_of_list( &mut self, list_id: &List, item: &SValue, ) -> Result<i64, Self::Error>
fn data_length_of_list(&mut self, list_id: &List) -> Result<i64, Self::Error>
fn data_delete_of_list( &mut self, list_id: &List, one_based_index: &SValue, ) -> Result<(), Self::Error>
fn data_delete_all_of_list(&mut self, list_id: &List) -> Result<(), Self::Error>
fn data_insert_at_list( &mut self, list_id: &List, one_based_index: &SValue, item: SValue, ) -> Result<(), Self::Error>
fn data_replace_list_at( &mut self, list_id: &List, one_based_index: &SValue, item: SValue, ) -> Result<(), Self::Error>
Provided Methods§
fn set_statement_as_context(&mut self, _id: &Id) -> Result<(), Self::Error>
fn request_random( &mut self, range: RangeInclusive<SNumber>, ) -> Result<SNumber, Self::Error>
fn data_change_variable_by( &mut self, var_id: &Variable, by: SValue, ) -> Result<(), Self::Error>
fn wait_for_secs(&mut self, _secs: SNumber) -> Result<(), Self::Error>
fn notice_event_block_executed( &mut self, _event: &EventBlockKind, _block: &ARc<BlockWrapper>, ) -> Result<(), Self::Error>
fn notice_proc_def_block_executed( &mut self, _def: &ProceduresDefinition, _block: &ARc<BlockWrapper>, ) -> Result<(), Self::Error>
fn notice_proc_proto_block_executed( &mut self, _proto: &ProceduresPrototype, _block: &ARc<BlockWrapper>, ) -> Result<(), Self::Error>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".