pub struct DataObject { /* private fields */ }
Implementations§
Source§impl DataObject
impl DataObject
pub fn get_type_constraint_for( variable_name: Option<&str>, ) -> &DataTypeConstraint
pub fn new_void() -> Self
pub fn new_text(str: impl Into<Rc<str>>) -> Self
pub fn new_number(value: impl Into<Number>) -> Self
pub fn new_optional_text(str: Option<impl Into<Rc<str>>>) -> Self
pub fn new_final_text(str: impl Into<Rc<str>>) -> Self
Sourcepub fn with_update(
func: impl FnOnce(&mut Self) -> Result<&mut DataObject, DataTypeConstraintError>,
) -> Result<DataObject, DataTypeConstraintError>
pub fn with_update( func: impl FnOnce(&mut Self) -> Result<&mut DataObject, DataTypeConstraintError>, ) -> Result<DataObject, DataTypeConstraintError>
This method allows the use of the rust “?” operator for data object creation
Sourcepub fn with_update_final(
func: impl FnOnce(&mut Self) -> Result<&mut DataObject, DataTypeConstraintError>,
) -> Result<DataObject, DataTypeConstraintError>
pub fn with_update_final( func: impl FnOnce(&mut Self) -> Result<&mut DataObject, DataTypeConstraintError>, ) -> Result<DataObject, DataTypeConstraintError>
This method allows the use of the rust “?” operator for data object creation and sets final data to true
Sourcepub fn update(
&mut self,
func: impl FnOnce(&mut Self) -> Result<&mut DataObject, DataTypeConstraintError>,
) -> Result<(), DataTypeConstraintError>
pub fn update( &mut self, func: impl FnOnce(&mut Self) -> Result<&mut DataObject, DataTypeConstraintError>, ) -> Result<(), DataTypeConstraintError>
This method allows the use of the rust “?” operator for data object updates
Sourcepub fn update_final(
&mut self,
func: impl FnOnce(&mut Self) -> Result<&mut DataObject, DataTypeConstraintError>,
) -> Result<(), DataTypeConstraintError>
pub fn update_final( &mut self, func: impl FnOnce(&mut Self) -> Result<&mut DataObject, DataTypeConstraintError>, ) -> Result<(), DataTypeConstraintError>
This method allows the use of the rust “?” operator for data object updates and sets final data to true
Sourcepub fn set_data(
&mut self,
data_object: &DataObject,
) -> Result<&mut Self, DataTypeConstraintError>
pub fn set_data( &mut self, data_object: &DataObject, ) -> Result<&mut Self, DataTypeConstraintError>
This method clones the value of data_object
into self.
This method ignores the final and static state of this data object
This method will not modify the variableName.
This method will also not modify final nor static flags (Except the copy static and final modifiers flag is set in data_object
)
pub fn set_text( &mut self, value: impl Into<Rc<str>>, ) -> Result<&mut Self, DataTypeConstraintError>
pub fn text_value(&self) -> Option<&str>
pub fn set_byte_buffer( &mut self, value: Box<[u8]>, ) -> Result<&mut Self, DataTypeConstraintError>
pub fn byte_buffer_value(&self) -> Option<Gc<GcCell<Box<[u8]>>>>
pub fn set_array( &mut self, value: Box<[DataObjectRef]>, ) -> Result<&mut Self, DataTypeConstraintError>
pub fn array_value(&self) -> Option<Gc<GcCell<Box<[DataObjectRef]>>>>
pub fn set_list( &mut self, value: VecDeque<DataObjectRef>, ) -> Result<&mut Self, DataTypeConstraintError>
pub fn list_value(&self) -> Option<Gc<GcCell<VecDeque<DataObjectRef>>>>
pub fn set_var_pointer( &mut self, value: DataObjectRef, ) -> Result<&mut Self, DataTypeConstraintError>
pub fn var_pointer_value(&self) -> Option<DataObjectRef>
pub fn set_function_pointer( &mut self, value: FunctionPointerObjectRef, ) -> Result<&mut Self, DataTypeConstraintError>
pub fn function_pointer_value(&self) -> Option<FunctionPointerObjectRef>
pub fn set_struct( &mut self, value: Gc<StructObject>, ) -> Result<&mut Self, DataTypeConstraintError>
pub fn struct_value(&self) -> Option<Gc<StructObject>>
pub fn set_object( &mut self, value: LangObjectRef, ) -> Result<&mut Self, DataTypeConstraintError>
pub fn object_value(&self) -> Option<LangObjectRef>
pub fn set_null(&mut self) -> Result<&mut Self, DataTypeConstraintError>
pub fn set_void(&mut self) -> Result<&mut Self, DataTypeConstraintError>
pub fn set_number( &mut self, value: Number, ) -> Result<&mut Self, DataTypeConstraintError>
pub fn set_int( &mut self, value: i32, ) -> Result<&mut Self, DataTypeConstraintError>
pub fn int_value(&self) -> Option<i32>
Sourcepub fn set_bool(
&mut self,
value: bool,
) -> Result<&mut Self, DataTypeConstraintError>
pub fn set_bool( &mut self, value: bool, ) -> Result<&mut Self, DataTypeConstraintError>
Sets data to INT with the value 1 if value
is true else 0
pub fn set_long( &mut self, value: i64, ) -> Result<&mut Self, DataTypeConstraintError>
pub fn long_value(&self) -> Option<i64>
pub fn set_float( &mut self, value: f32, ) -> Result<&mut Self, DataTypeConstraintError>
pub fn float_value(&self) -> Option<f32>
pub fn set_double( &mut self, value: f64, ) -> Result<&mut Self, DataTypeConstraintError>
pub fn double_value(&self) -> Option<f64>
pub fn set_char( &mut self, value: char, ) -> Result<&mut Self, DataTypeConstraintError>
pub fn char_value(&self) -> Option<char>
pub fn set_error( &mut self, value: Gc<ErrorObject>, ) -> Result<&mut Self, DataTypeConstraintError>
pub fn error_value(&self) -> Option<Gc<ErrorObject>>
pub fn set_type( &mut self, value: DataType, ) -> Result<&mut Self, DataTypeConstraintError>
pub fn type_value(&self) -> Option<DataType>
Sourcepub fn number_value(&self) -> Option<Number>
pub fn number_value(&self) -> Option<Number>
This method returns Some for INT, LONG, FLOAT, and DOUBLE values and should only be used for native function parameters with the “number” parameter type
This method does not convert the data object into a number if it is none. A data object can be converted with conversions::to_number
Sourcepub fn bool_value(&self) -> Option<bool>
pub fn bool_value(&self) -> Option<bool>
This method returns Some for INT values and should only be used for native function parameters with the “boolean” parameter type
This method does not convert the data object into a boolean if it is none. A data object can be converted with conversions::to_bool
pub fn set_variable_name( &mut self, variable_name: Option<&str>, ) -> Result<&mut Self, DataTypeConstraintError>
pub fn variable_name(&self) -> Option<&str>
pub fn set_final_data(&mut self, final_data: bool) -> &mut Self
pub fn is_final_data(&self) -> bool
pub fn set_static_data(&mut self, final_data: bool) -> &mut Self
pub fn is_static_data(&self) -> bool
pub fn is_copy_static_and_final_modifiers(&self) -> bool
pub fn is_lang_var(&self) -> bool
pub fn data_type(&self) -> DataType
pub fn type_constraint(&self) -> &DataTypeConstraint
pub fn check_type( &self, data_type: DataType, ) -> Result<(), DataTypeConstraintError>
pub fn member_visibility(&self) -> Option<Visibility>
pub fn member_of_class(&self) -> i64
pub fn is_accessible(&self, accessing_class: Option<&LangObjectRef>) -> bool
Trait Implementations§
Source§impl Debug for DataObject
impl Debug for DataObject
Source§impl Default for DataObject
impl Default for DataObject
Source§impl Display for DataObject
impl Display for DataObject
Source§impl Drop for DataObject
impl Drop for DataObject
Source§impl Trace for DataObject
impl Trace for DataObject
Source§fn finalize_glue(&self)
fn finalize_glue(&self)
Finalize::finalize()
on this object and all
contained subobjects