Struct lib_ruby_parser::nodes::Block
source · [−]#[repr(C)]pub struct Block {
pub call: Box<Node>,
pub args: Option<Box<Node>>,
pub body: Option<Box<Node>>,
pub begin_l: Loc,
pub end_l: Loc,
pub expression_l: Loc,
}Expand description
Represents a Ruby block that is passed to a method (proc { |foo| bar })
Fields
call: Box<Node>Method call that takes a block
Send("foo") in foo {}
args: Option<Box<Node>>A list of argument that block takes
vec![ Arg("a"), Optarg("b", Int("1")) ] for proc { |a, b = 1| }
None if the block takes no arguments
body: Option<Box<Node>>Block body, None if block has no body.
begin_l: LocLocation of the open brace
proc { }
~end_l: LocLocation of the closing brace
proc { }
~expression_l: LocLocation of the full expression
proc { }
~~~~~~~~Trait Implementations
impl StructuralPartialEq for Block
Auto Trait Implementations
impl RefUnwindSafe for Block
impl Send for Block
impl Sync for Block
impl Unpin for Block
impl UnwindSafe for Block
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