[][src]Struct boa::gc::GcObject

pub struct GcObject(_);

Garbage collected Object.

Implementations

impl GcObject[src]

pub fn new(object: Object) -> Self[src]

Create a new GcObject from a Object.

pub fn borrow(&self) -> Ref<'_>[src]

Immutably borrows the Object.

The borrow lasts until the returned GcCellRef exits scope. Multiple immutable borrows can be taken out at the same time.

Panics

Panics if the object is currently mutably borrowed.

pub fn borrow_mut(&self) -> RefMut<'_>[src]

Mutably borrows the Object.

The borrow lasts until the returned GcCellRefMut exits scope. The object cannot be borrowed while this borrow is active.

Panics

Panics if the object is currently borrowed.

pub fn try_borrow(&self) -> StdResult<Ref<'_>, BorrowError>[src]

Immutably borrows the Object, 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.

pub fn try_borrow_mut(&self) -> StdResult<RefMut<'_>, BorrowMutError>[src]

Mutably borrows the object, returning an error if the value is currently borrowed.

The borrow lasts until the returned GcCellRefMut exits scope. The object be borrowed while this borrow is active.

This is the non-panicking variant of borrow_mut.

pub fn equals(lhs: &Self, rhs: &Self) -> bool[src]

Checks if the garbage collected memory is the same.

pub fn call(
    &self,
    this: &Value,
    args: &[Value],
    ctx: &mut Context
) -> Result<Value>
[src]

Call this object.

Panics

Panics if the object is currently mutably borrowed.

pub fn construct(&self, args: &[Value], ctx: &mut Context) -> Result<Value>[src]

Construct an instance of this object with the specified arguments.

Panics

Panics if the object is currently mutably borrowed.

Trait Implementations

impl AsRef<GcCell<Object>> for GcObject[src]

impl Clone for GcObject[src]

impl Debug for GcObject[src]

impl Drop for GcObject[src]

impl Finalize for GcObject[src]

impl From<GcObject> for Value[src]

impl Trace for GcObject[src]

Auto Trait Implementations

impl !RefUnwindSafe for GcObject

impl !Send for GcObject

impl !Sync for GcObject

impl Unpin for GcObject

impl !UnwindSafe for GcObject

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> NativeObject for T where
    T: Any + Debug + Trace
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

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