Struct lib_ruby_parser::nodes::Ensure
source · [−]#[repr(C)]pub struct Ensure {
pub body: Option<Box<Node>>,
pub ensure: Option<Box<Node>>,
pub keyword_l: Loc,
pub expression_l: Loc,
}Expand description
Represents a block of code with ensure (i.e. begin; ensure; end)
Fields
body: Option<Box<Node>>Block of code that is wrapped into ensure
Note: that’s the body of the ensure block
Int("1") for begin; 1; ensure; 2; end
ensure: Option<Box<Node>>Body of the ensure block
Int("2") for begin; 1; ensure; 2; end
keyword_l: LocLocation of the ensure keyword
begin; ensure; end
~~~~~~expression_l: LocLocation of the full expression
begin; 1; rescue; 2; else; 3; ensure; 4; end
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Note: begin/end belong to KwBegin node.
Trait Implementations
impl StructuralPartialEq for Ensure
Auto Trait Implementations
impl RefUnwindSafe for Ensure
impl Send for Ensure
impl Sync for Ensure
impl Unpin for Ensure
impl UnwindSafe for Ensure
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