Struct rustfmt_nightly::expr::ControlFlow
source · struct ControlFlow<'a> {
cond: Option<&'a Expr>,
block: &'a Block,
else_block: Option<&'a Expr>,
label: Option<Label>,
pat: Option<&'a Pat>,
keyword: &'a str,
matcher: &'a str,
connector: &'a str,
allow_single_line: bool,
nested_if: bool,
span: Span,
}Fields
cond: Option<&'a Expr>block: &'a Blockelse_block: Option<&'a Expr>label: Option<Label>pat: Option<&'a Pat>keyword: &'a strmatcher: &'a strconnector: &'a strallow_single_line: boolnested_if: boolspan: SpanImplementations
sourceimpl<'a> ControlFlow<'a>
impl<'a> ControlFlow<'a>
fn new_if(
cond: &'a Expr,
pat: Option<&'a Pat>,
block: &'a Block,
else_block: Option<&'a Expr>,
allow_single_line: bool,
nested_if: bool,
span: Span
) -> ControlFlow<'a>
fn new_loop(block: &'a Block, label: Option<Label>, span: Span) -> ControlFlow<'a>
fn new_while(
pat: Option<&'a Pat>,
cond: &'a Expr,
block: &'a Block,
label: Option<Label>,
span: Span
) -> ControlFlow<'a>
fn new_for(
pat: &'a Pat,
cond: &'a Expr,
block: &'a Block,
label: Option<Label>,
span: Span
) -> ControlFlow<'a>
fn rewrite_single_line(
&self,
pat_expr_str: &str,
context: &RewriteContext<'_>,
width: usize
) -> Option<String>
sourceimpl<'a> ControlFlow<'a>
impl<'a> ControlFlow<'a>
fn rewrite_pat_expr(
&self,
context: &RewriteContext<'_>,
expr: &Expr,
shape: Shape,
offset: usize
) -> Option<String>
fn rewrite_cond(
&self,
context: &RewriteContext<'_>,
shape: Shape,
alt_block_sep: &str
) -> Option<(String, usize)>
Trait Implementations
sourceimpl<'a> Debug for ControlFlow<'a>
impl<'a> Debug for ControlFlow<'a>
sourceimpl<'a> Rewrite for ControlFlow<'a>
impl<'a> Rewrite for ControlFlow<'a>
Auto Trait Implementations
impl<'a> !RefUnwindSafe for ControlFlow<'a>
impl<'a> !Send for ControlFlow<'a>
impl<'a> !Sync for ControlFlow<'a>
impl<'a> Unpin for ControlFlow<'a>
impl<'a> !UnwindSafe for ControlFlow<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Layout
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 104 bytes