pub struct Reference { /* private fields */ }
Implementations§
Source§impl Reference
impl Reference
pub fn null() -> Reference
pub fn is_null(&self) -> bool
pub fn is_transferred(&self) -> bool
pub fn is_being_written(&mut self) -> bool
pub fn new_boolean(value: bool, registry: &Registry) -> Reference
pub fn new_integer(value: i64, registry: &Registry) -> Reference
pub fn new_real(value: f64, registry: &Registry) -> Reference
pub fn new_text(value: String, registry: &Registry) -> Reference
pub fn new_array(value: Vec<Reference>, registry: &Registry) -> Reference
pub fn new_map( value: HashMap<String, Reference>, registry: &Registry, ) -> Reference
pub fn new_type(value: Type, registry: &Registry) -> Reference
pub fn new_function(value: Function, registry: &Registry) -> Reference
pub fn new<T>(data: T, registry: &Registry) -> Referencewhere
T: 'static,
pub fn new_custom<T>(data: T, ty: &Type) -> Referencewhere
T: 'static,
pub fn new_raw(data: Object) -> Reference
pub fn initialized(ty: &Type) -> Reference
Sourcepub unsafe fn uninitialized(ty: &Type) -> Reference
pub unsafe fn uninitialized(ty: &Type) -> Reference
§Safety
pub fn type_of(&self) -> Option<Type>
pub fn read<T>(&self) -> Option<Ref<'_, T>>where
T: 'static,
pub fn write<T>(&mut self) -> Option<RefMut<'_, T>>where
T: 'static,
pub fn read_object(&self) -> Option<Ref<'_, Object>>
pub fn write_object(&mut self) -> Option<RefMut<'_, Object>>
pub fn swap<T>(&mut self, data: T) -> Option<T>where
T: 'static,
pub fn try_consume(self) -> Result<Object, Reference>
pub fn references_count(&self) -> usize
Trait Implementations§
Source§impl From<Reference> for Transferable
impl From<Reference> for Transferable
Source§fn from(value: Reference) -> Transferable
fn from(value: Reference) -> Transferable
Converts to this type from the input type.
Source§impl From<Transferable> for Reference
impl From<Transferable> for Reference
Source§fn from(value: Transferable) -> Reference
fn from(value: Transferable) -> Reference
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Reference
impl !RefUnwindSafe for Reference
impl !Send for Reference
impl !Sync for Reference
impl Unpin for Reference
impl !UnwindSafe for Reference
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more