DataObject

Struct DataObject 

Source
pub struct DataObject { /* private fields */ }

Implementations§

Source§

impl DataObject

Source

pub fn get_type_constraint_for( variable_name: Option<&str>, ) -> &DataTypeConstraint

Source

pub fn new() -> Self

Creates a new data object of type NULL

Source

pub fn new_void() -> Self

Source

pub fn new_text(str: impl Into<Rc<str>>) -> Self

Source

pub fn new_number(value: impl Into<Number>) -> Self

Source

pub fn new_optional_text(str: Option<impl Into<Rc<str>>>) -> Self

Source

pub fn new_final_text(str: impl Into<Rc<str>>) -> Self

Source

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

Source

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

Source

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

Source

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

Source

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)

Source

pub fn set_text( &mut self, value: impl Into<Rc<str>>, ) -> Result<&mut Self, DataTypeConstraintError>

Source

pub fn text_value(&self) -> Option<&str>

Source

pub fn set_byte_buffer( &mut self, value: Box<[u8]>, ) -> Result<&mut Self, DataTypeConstraintError>

Source

pub fn byte_buffer_value(&self) -> Option<Gc<GcCell<Box<[u8]>>>>

Source

pub fn set_array( &mut self, value: Box<[DataObjectRef]>, ) -> Result<&mut Self, DataTypeConstraintError>

Source

pub fn array_value(&self) -> Option<Gc<GcCell<Box<[DataObjectRef]>>>>

Source

pub fn set_list( &mut self, value: VecDeque<DataObjectRef>, ) -> Result<&mut Self, DataTypeConstraintError>

Source

pub fn list_value(&self) -> Option<Gc<GcCell<VecDeque<DataObjectRef>>>>

Source

pub fn set_var_pointer( &mut self, value: DataObjectRef, ) -> Result<&mut Self, DataTypeConstraintError>

Source

pub fn var_pointer_value(&self) -> Option<DataObjectRef>

Source

pub fn set_function_pointer( &mut self, value: FunctionPointerObjectRef, ) -> Result<&mut Self, DataTypeConstraintError>

Source

pub fn function_pointer_value(&self) -> Option<FunctionPointerObjectRef>

Source

pub fn set_struct( &mut self, value: Gc<StructObject>, ) -> Result<&mut Self, DataTypeConstraintError>

Source

pub fn struct_value(&self) -> Option<Gc<StructObject>>

Source

pub fn set_object( &mut self, value: LangObjectRef, ) -> Result<&mut Self, DataTypeConstraintError>

Source

pub fn object_value(&self) -> Option<LangObjectRef>

Source

pub fn set_null(&mut self) -> Result<&mut Self, DataTypeConstraintError>

Source

pub fn set_void(&mut self) -> Result<&mut Self, DataTypeConstraintError>

Source

pub fn set_number( &mut self, value: Number, ) -> Result<&mut Self, DataTypeConstraintError>

Source

pub fn set_int( &mut self, value: i32, ) -> Result<&mut Self, DataTypeConstraintError>

Source

pub fn int_value(&self) -> Option<i32>

Source

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

Source

pub fn set_long( &mut self, value: i64, ) -> Result<&mut Self, DataTypeConstraintError>

Source

pub fn long_value(&self) -> Option<i64>

Source

pub fn set_float( &mut self, value: f32, ) -> Result<&mut Self, DataTypeConstraintError>

Source

pub fn float_value(&self) -> Option<f32>

Source

pub fn set_double( &mut self, value: f64, ) -> Result<&mut Self, DataTypeConstraintError>

Source

pub fn double_value(&self) -> Option<f64>

Source

pub fn set_char( &mut self, value: char, ) -> Result<&mut Self, DataTypeConstraintError>

Source

pub fn char_value(&self) -> Option<char>

Source

pub fn set_error( &mut self, value: Gc<ErrorObject>, ) -> Result<&mut Self, DataTypeConstraintError>

Source

pub fn error_value(&self) -> Option<Gc<ErrorObject>>

Source

pub fn set_type( &mut self, value: DataType, ) -> Result<&mut Self, DataTypeConstraintError>

Source

pub fn type_value(&self) -> Option<DataType>

Source

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

Source

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

Source

pub fn set_variable_name( &mut self, variable_name: Option<&str>, ) -> Result<&mut Self, DataTypeConstraintError>

Source

pub fn variable_name(&self) -> Option<&str>

Source

pub fn set_final_data(&mut self, final_data: bool) -> &mut Self

Source

pub fn is_final_data(&self) -> bool

Source

pub fn set_static_data(&mut self, final_data: bool) -> &mut Self

Source

pub fn is_static_data(&self) -> bool

Source

pub fn is_copy_static_and_final_modifiers(&self) -> bool

Source

pub fn is_lang_var(&self) -> bool

Source

pub fn data_type(&self) -> DataType

Source

pub fn type_constraint(&self) -> &DataTypeConstraint

Source

pub fn check_type( &self, data_type: DataType, ) -> Result<(), DataTypeConstraintError>

Source

pub fn member_visibility(&self) -> Option<Visibility>

Source

pub fn member_of_class(&self) -> i64

Source

pub fn is_accessible(&self, accessing_class: Option<&LangObjectRef>) -> bool

Trait Implementations§

Source§

impl Debug for DataObject

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for DataObject

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Display for DataObject

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for DataObject

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Finalize for DataObject

Source§

impl Trace for DataObject

Source§

unsafe fn trace(&self)

Marks all contained Gcs.
Source§

unsafe fn root(&self)

Increments the root-count of all contained Gcs.
Source§

unsafe fn unroot(&self)

Decrements the root-count of all contained Gcs.
Source§

fn finalize_glue(&self)

Runs Finalize::finalize() on this object and all contained subobjects

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V