Skip to main content

ObjectData

Struct ObjectData 

Source
pub struct ObjectData { /* private fields */ }
Expand description

An object: a payload and the prototype that defines its type. A Value::Object is an Rc pointer to ObjectData.

proto is the Module terminal that is the instance; methods dispatched on the object run in this environment. This is also the handle used by Value::Iota’s home.

data is a single-slot payload. Records with named fields are not yet implemented; maps are the current idiom. Only the module’s own code can access this via __value.

Implementations§

Source§

impl ObjectData

Source

pub fn proto(&self) -> Value

The object’s prototype, as the module value it is.

Source

pub fn data(&self) -> &Value

The object’s payload. Public to Rust because a debugger and an embedding host sit outside the language’s module scope; no builtin hands it out, so Elly code cannot reach it except through its own module’s __value.

Trait Implementations§

Source§

impl Debug for ObjectData

Source§

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

Formats the value using the given formatter. Read more

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, 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.