[−][src]Trait arithmetic_eval::ModuleId
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
pub 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<F, A> Future for Box<F, A> where
A: AllocRef,
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
A: AllocRef,
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
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<F, A> Future for Box<F, A> where
A: AllocRef,
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
A: AllocRef,
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
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
Implementations on Foreign Types
impl ModuleId for &'static str
[src]
pub 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<F, A> Future for Box<F, A> where
A: AllocRef,
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
A: AllocRef,
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
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<F, A> Future for Box<F, A> where
A: AllocRef,
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
A: AllocRef,
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
Implementors
impl ModuleId for IndexedId
[src]
pub 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<F, A> Future for Box<F, A> where
A: AllocRef,
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
A: AllocRef,
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
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<F, A> Future for Box<F, A> where
A: AllocRef,
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
A: AllocRef,
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
impl ModuleId for WildcardId
[src]
pub 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<F, A> Future for Box<F, A> where
A: AllocRef,
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
A: AllocRef,
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
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<F, A> Future for Box<F, A> where
A: AllocRef,
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
A: AllocRef,
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;