ExternOwned

Trait ExternOwned 

Source
pub trait ExternOwned {
    // Required method
    fn index<'host>(
        self: Rc<Self>,
        index: Value<'host>,
    ) -> Result<Value<'host>, Error>;

    // Provided methods
    fn any(&self) -> Option<&(dyn Any + 'static)> { ... }
    fn debug(&self, f: &mut Formatter<'_>) -> Result<(), Error> { ... }
}

Required Methods§

Source

fn index<'host>( self: Rc<Self>, index: Value<'host>, ) -> Result<Value<'host>, Error>

Note that self’s reference count will always be greater than one, so Rc::unwrap_or_clone, Rc::get_mut, etc. are useless.

Provided Methods§

Source

fn any(&self) -> Option<&(dyn Any + 'static)>

Allows the ExternOwned trait object to be downcasted back into its original type.

Implementing this method is optional. The default implementation will always return None and reject all downcasting attempts via Value::downcast_extern.

There is no way to downcast from an Rc<dyn Any>, so this functin has the same signature as Extern’s equivalent.

Source

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

Implementors§