pub struct Js<T>(pub T);Expand description
A number written as JavaScript writes it, for format! in generated code: ${n} in a template
literal, "#" + n, n.toString().
Display is implemented for Js<i64>, written as push_int writes it, and Js<f64>,
written as push_number writes it.
§Example
use ferrovue::Js;
assert_eq!(format!("{} items", Js(3_i64)), "3 items");
assert_eq!(format!("{}", Js(1.5e-7_f64)), "1.5e-7");Tuple Fields§
§0: TTrait Implementations§
impl<T: Copy> Copy for Js<T>
Auto Trait Implementations§
impl<T> Freeze for Js<T>where
T: Freeze,
impl<T> RefUnwindSafe for Js<T>where
T: RefUnwindSafe,
impl<T> Send for Js<T>where
T: Send,
impl<T> Sync for Js<T>where
T: Sync,
impl<T> Unpin for Js<T>where
T: Unpin,
impl<T> UnsafeUnpin for Js<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Js<T>where
T: UnwindSafe,
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