pub enum DisplayFormat {
Repl,
Expression,
Eval,
}Variants§
Repl
Display the value as a string that can be passed to a JavaScript REPL. In this mode, the final statement of the string is not terminated with a semicolon and may be wrapped in parentheses to make it an expression statement.
This is usually the clearest way to display a value to a user.
Expression
Display the value as a string that can be used in an expression position, such as the RHS of a function. If intermediate variables are needed, the entire string is wrapped in an IIFE.
Eval
Display the value as a string that can be passed to eval(). One should use
indirect eval (for example (0, eval)()) to avoid polluting the current
scope.
Auto Trait Implementations§
impl Freeze for DisplayFormat
impl RefUnwindSafe for DisplayFormat
impl Send for DisplayFormat
impl Sync for DisplayFormat
impl Unpin for DisplayFormat
impl UnwindSafe for DisplayFormat
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