Trait rhai::Variant[][src]

pub trait Variant: Any + Sealed {
    fn as_any(&self) -> &dyn Any;
fn as_mut_any(&mut self) -> &mut dyn Any;
fn as_box_any(self: Box<Self>) -> Box<dyn Any>

Notable traits for Box<R, Global>

impl<R> Read for Box<R, Global> where
    R: Read + ?Sized
impl<W> Write for Box<W, Global> where
    W: Write + ?Sized
impl<I, A> Iterator for Box<I, A> where
    A: Allocator,
    I: Iterator + ?Sized
type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
    A: Allocator + 'static,
    F: Future + Unpin + ?Sized
type Output = <F as Future>::Output;
;
fn type_name(&self) -> &'static str;
fn into_dynamic(self) -> Dynamic;
fn clone_into_dynamic(&self) -> Dynamic; }

(INTERNALS) Trait to represent any type. Exported under the internals feature only.

This trait is sealed and cannot be implemented.

Currently, Variant is not Send nor Sync, so it can practically be any type. Turn on the sync feature to restrict it to only types that implement Send + Sync.

Required methods

fn as_any(&self) -> &dyn Any[src]

Convert this Variant trait object to &dyn Any.

fn as_mut_any(&mut self) -> &mut dyn Any[src]

Convert this Variant trait object to &mut dyn Any.

fn as_box_any(self: Box<Self>) -> Box<dyn Any>

Notable traits for Box<R, Global>

impl<R> Read for Box<R, Global> where
    R: Read + ?Sized
impl<W> Write for Box<W, Global> where
    W: Write + ?Sized
impl<I, A> Iterator for Box<I, A> where
    A: Allocator,
    I: Iterator + ?Sized
type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
    A: Allocator + 'static,
    F: Future + Unpin + ?Sized
type Output = <F as Future>::Output;
[src]

Convert this Variant trait object to an Any trait object.

fn type_name(&self) -> &'static str[src]

Get the name of this type.

fn into_dynamic(self) -> Dynamic[src]

Convert into Dynamic.

fn clone_into_dynamic(&self) -> Dynamic[src]

Clone into Dynamic.

Loading content...

Implementations

impl dyn Variant[src]

pub fn is<T: Any>(&self) -> bool[src]

Is this Variant a specific type?

Implementors

impl<T: Any + Clone + SendSync> Variant for T[src]

Loading content...