pub struct CommentArg(pub String);Expand description
A wrapper to mark a string as an inline comment arg (for %R / $comment).
Use CommentArg when your format string uses %R to emit a language-specific
comment at the current position.
§Examples
use sigil_stitch::code_block::{CodeBlock, CommentArg};
let mut cb = CodeBlock::builder();
cb.add_statement("const x = 42; %R", (CommentArg("TODO: validate".to_string()),));
let block = cb.build().unwrap();Tuple Fields§
§0: StringTrait Implementations§
Source§impl From<CommentArg> for Arg
impl From<CommentArg> for Arg
Source§fn from(s: CommentArg) -> Self
fn from(s: CommentArg) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for CommentArg
impl RefUnwindSafe for CommentArg
impl Send for CommentArg
impl Sync for CommentArg
impl Unpin for CommentArg
impl UnsafeUnpin for CommentArg
impl UnwindSafe for CommentArg
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