pub struct DataObjectRef(/* private fields */);
Implementations§
Source§impl DataObjectRef
impl DataObjectRef
pub fn new(data_object: DataObject) -> Self
pub fn text_value(&self) -> Option<Box<str>>
pub fn byte_buffer_value(&self) -> Option<Gc<GcCell<Box<[u8]>>>>
pub fn array_value(&self) -> Option<Gc<GcCell<Box<[DataObjectRef]>>>>
pub fn list_value(&self) -> Option<Gc<GcCell<VecDeque<DataObjectRef>>>>
pub fn var_pointer_value(&self) -> Option<DataObjectRef>
pub fn function_pointer_value(&self) -> Option<FunctionPointerObjectRef>
pub fn struct_value(&self) -> Option<Gc<StructObject>>
pub fn object_value(&self) -> Option<LangObjectRef>
pub fn int_value(&self) -> Option<i32>
pub fn long_value(&self) -> Option<i64>
pub fn float_value(&self) -> Option<f32>
pub fn double_value(&self) -> Option<f64>
pub fn char_value(&self) -> Option<char>
pub fn error_value(&self) -> Option<Gc<ErrorObject>>
pub fn type_value(&self) -> Option<DataType>
Sourcepub fn number_value(&self) -> Option<Number>
pub fn number_value(&self) -> Option<Number>
This method borrows the data object and copies the value from DataObject::number_value
Sourcepub fn bool_value(&self) -> Option<bool>
pub fn bool_value(&self) -> Option<bool>
This method borrows the data object and copies the value from DataObject::bool_value
pub fn variable_name(&self) -> Option<Box<str>>
pub fn is_final_data(&self) -> bool
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
Sourcepub fn type_constraint(&self) -> DataTypeConstraint
pub fn type_constraint(&self) -> DataTypeConstraint
This functions clones data
pub fn member_visibility(&self) -> Option<Visibility>
pub fn member_of_class(&self) -> i64
pub fn is_accessible(&self, accessing_class: Option<&LangObjectRef>) -> bool
Methods from Deref<Target = GcCell<DataObject>>§
Sourcepub fn borrow(&self) -> GcCellRef<'_, T>
pub fn borrow(&self) -> GcCellRef<'_, T>
Immutably borrows the wrapped value.
The borrow lasts until the returned GcCellRef
exits scope.
Multiple immutable borrows can be taken out at the same time.
§Panics
Panics if the value is currently mutably borrowed.
Sourcepub fn borrow_mut(&self) -> GcCellRefMut<'_, T>
pub fn borrow_mut(&self) -> GcCellRefMut<'_, T>
Mutably borrows the wrapped value.
The borrow lasts until the returned GcCellRefMut
exits scope.
The value cannot be borrowed while this borrow is active.
§Panics
Panics if the value is currently borrowed.
Sourcepub fn try_borrow(&self) -> Result<GcCellRef<'_, T>, BorrowError>
pub fn try_borrow(&self) -> Result<GcCellRef<'_, T>, BorrowError>
Immutably borrows the wrapped value, returning an error if the value is currently mutably borrowed.
The borrow lasts until the returned GcCellRef
exits scope. Multiple immutable borrows can be
taken out at the same time.
This is the non-panicking variant of borrow
.
§Examples
use gc::GcCell;
let c = GcCell::new(5);
{
let m = c.borrow_mut();
assert!(c.try_borrow().is_err());
}
{
let m = c.borrow();
assert!(c.try_borrow().is_ok());
}
Sourcepub fn try_borrow_mut(&self) -> Result<GcCellRefMut<'_, T>, BorrowMutError>
pub fn try_borrow_mut(&self) -> Result<GcCellRefMut<'_, T>, BorrowMutError>
Mutably borrows the wrapped value, returning an error if the value is currently borrowed.
The borrow lasts until the returned GcCellRefMut
exits scope.
The value cannot be borrowed while this borrow is active.
This is the non-panicking variant of borrow_mut
.
§Examples
use gc::GcCell;
let c = GcCell::new(5);
{
let m = c.borrow();
assert!(c.try_borrow_mut().is_err());
}
assert!(c.try_borrow_mut().is_ok());
Trait Implementations§
Source§impl AnyWithEq for DataObjectRef
impl AnyWithEq for DataObjectRef
fn as_any(&self) -> &dyn Any
fn is_equals( &self, other: &dyn AnyWithEq, interpreter: &mut Interpreter, pos: CodePosition, ) -> bool
fn is_strict_equals( &self, other: &dyn AnyWithEq, interpreter: &mut Interpreter, pos: CodePosition, ) -> bool
Source§impl Clone for DataObjectRef
impl Clone for DataObjectRef
Source§fn clone(&self) -> DataObjectRef
fn clone(&self) -> DataObjectRef
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for DataObjectRef
impl Debug for DataObjectRef
Source§impl Default for DataObjectRef
impl Default for DataObjectRef
Source§fn default() -> DataObjectRef
fn default() -> DataObjectRef
Source§impl Deref for DataObjectRef
impl Deref for DataObjectRef
Source§impl Drop for DataObjectRef
impl Drop for DataObjectRef
Source§impl Trace for DataObjectRef
impl Trace for DataObjectRef
Source§fn finalize_glue(&self)
fn finalize_glue(&self)
Finalize::finalize()
on this object and all
contained subobjects