Trait arithmetic_eval::ModuleId[][src]

pub trait ModuleId: Any + Display + Send + Sync {
    fn clone_boxed(&self) -> Box<dyn ModuleId>

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;
; }
Expand description

Identifier of an ExecutableModule. This is usually a “small” type, such as an integer or a string.

The ID is provided when creating a module. It is displayed in error messages (using Display::fmt). ModuleId is also associated with some types (e.g., InterpretedFn and CodeInModule), which allows to obtain module info. This can be particularly useful for outputting rich error information.

A ModuleId can be downcast to a specific type, similarly to Any.

Required methods

fn clone_boxed(&self) -> Box<dyn ModuleId>

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]

Clones this module ID and boxes the result. It is expected that the output will have the same specific type as the original module ID. This operation is generally expected to be quite cheap.

Implementations

impl dyn ModuleId[src]

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

Returns true if the boxed type is the same as T.

This method is effectively a carbon copy of <dyn Any>::is. Such a copy is necessary because &dyn ModuleId cannot be converted to &dyn Any, despite ModuleId having Any as a super-trait.

pub fn downcast_ref<T: ModuleId>(&self) -> Option<&T>[src]

Returns a reference to the boxed value if it is of type T, or None if it isn’t.

This method is effectively a carbon copy of <dyn Any>::downcast_ref. Such a copy is necessary because &dyn ModuleId cannot be converted to &dyn Any, despite ModuleId having Any as a super-trait.

Trait Implementations

impl Debug for dyn ModuleId[src]

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

Implementations on Foreign Types

impl ModuleId for &'static str[src]

fn clone_boxed(&self) -> Box<dyn ModuleId>

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]

Implementors

impl ModuleId for IndexedId[src]

fn clone_boxed(&self) -> Box<dyn ModuleId>

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]

impl ModuleId for WildcardId[src]

fn clone_boxed(&self) -> Box<dyn ModuleId>

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]