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 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
Implementations§
source§impl<'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>
source§impl<'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§
source§impl<'a> Debug for ControlFlow<'a>
impl<'a> Debug 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§
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
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