pub struct StringLitArg(pub String);Expand description
A wrapper to explicitly mark a string as a StringLit arg (for %S).
By default, bare strings convert to Arg::Literal (for %L). Wrap with
StringLitArg when your format string uses %S to emit a quoted string.
§Examples
use sigil_stitch::code_block::{CodeBlock, StringLitArg};
use sigil_stitch::lang::typescript::TypeScript;
let mut cb = CodeBlock::builder();
cb.add_statement("const msg = %S", (StringLitArg("hello".to_string()),));
let block = cb.build().unwrap();Tuple Fields§
§0: StringTrait Implementations§
Source§impl From<StringLitArg> for Arg
impl From<StringLitArg> for Arg
Source§fn from(s: StringLitArg) -> Self
fn from(s: StringLitArg) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for StringLitArg
impl RefUnwindSafe for StringLitArg
impl Send for StringLitArg
impl Sync for StringLitArg
impl Unpin for StringLitArg
impl UnsafeUnpin for StringLitArg
impl UnwindSafe for StringLitArg
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