#[non_exhaustive]pub enum Mode<'a> {
Script,
Module {
name: &'a str,
},
Repl,
}Expand description
Compilation mode
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Script
Compile as script: return value is value of final statement or early return
Module
Compile as module: return value is a module of top-level bindings, or that of early return
Repl
Compile in REPL mode:
- Return value is a module of top-level bindings, including private bindings (e.g. imports)
- Early return is disallowed at top level
- Value of final statement is bound to
_
Trait Implementations§
impl<'a> Eq for Mode<'a>
impl<'a> StructuralPartialEq for Mode<'a>
Auto Trait Implementations§
impl<'a> Freeze for Mode<'a>
impl<'a> RefUnwindSafe for Mode<'a>
impl<'a> Send for Mode<'a>
impl<'a> Sync for Mode<'a>
impl<'a> Unpin for Mode<'a>
impl<'a> UnsafeUnpin for Mode<'a>
impl<'a> UnwindSafe for Mode<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more