pub struct StmtVec(pub Vec<Stmt>);Expand description
A wrapper type for passing a Vec<Stmt> to be used inline in function bodies.
This is a marker type that ts_quote! can detect and handle specially,
allowing you to interpolate multiple statements where the macro expects them.
§Examples
use macroforge_ts_syn::{StmtVec, stmt_vec};
use macroforge_ts_syn::swc_ecma_ast::Stmt;
// Create directly with constructor
let statements1: Vec<Stmt> = vec![];
let _wrapped1 = StmtVec(statements1);
// Or using the macro
let statements2: Vec<Stmt> = vec![];
let _wrapped2 = stmt_vec!(statements2);Tuple Fields§
§0: Vec<Stmt>Auto Trait Implementations§
impl Freeze for StmtVec
impl RefUnwindSafe for StmtVec
impl Send for StmtVec
impl Sync for StmtVec
impl Unpin for StmtVec
impl UnwindSafe for StmtVec
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more