pub struct NameArg(pub String);Expand description
A wrapper to explicitly mark a string as a Name arg (for %N).
By default, bare strings convert to Arg::Literal (for %L). Wrap with
NameArg when your format string uses %N.
§Examples
use sigil_stitch::code_block::{CodeBlock, NameArg};
use sigil_stitch::lang::typescript::TypeScript;
let mut cb = CodeBlock::builder();
cb.add("this.%N()", (NameArg("getData".to_string()),));
let block = cb.build().unwrap();Tuple Fields§
§0: StringTrait Implementations§
Auto Trait Implementations§
impl Freeze for NameArg
impl RefUnwindSafe for NameArg
impl Send for NameArg
impl Sync for NameArg
impl Unpin for NameArg
impl UnsafeUnpin for NameArg
impl UnwindSafe for NameArg
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