Block

Struct Block 

Source
pub struct Block<'source> {
    pub result: BlockResult<'source>,
    pub diagnostics: Diagnostics<'source>,
    pub statements: [Statement<'source>],
}

Fields§

§result: BlockResult<'source>§diagnostics: Diagnostics<'source>§statements: [Statement<'source>]

Implementations§

Source§

impl<'source> Block<'source>

Source

pub fn build<G>( result: BlockResult<'source>, diagnostics: Diagnostics<'source>, statements: G, ) -> Box<Self>
where G: IntoIterator<Item = Statement<'source>>, <G as IntoIterator>::IntoIter: ExactSizeIterator,

Creates an instance of Box<Block>.

Source

pub fn build_from_slice( result: BlockResult<'source>, diagnostics: Diagnostics<'source>, statements: &[Statement<'source>], ) -> Box<Self>
where Statement<'source>: Copy,

Creates an instance of Box<Block>.

Source

pub fn destructure( this: Box<Self>, ) -> (BlockResult<'source>, Diagnostics<'source>, BlockIter<'source>)

Destructures an instance of Box<Block>, returning the tail slice as an iterator.

Source§

impl<'source> Block<'source>

Source

pub fn new(lexer: &mut Peekable<Lexer<'source>>) -> Box<Self>

Trait Implementations§

Source§

impl<'source> Debug for Block<'source>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Box<Block<'_>>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'source> PartialEq for Block<'source>

Source§

fn eq(&self, other: &Block<'source>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'source> Eq for Block<'source>

Source§

impl<'source> StructuralPartialEq for Block<'source>

Auto Trait Implementations§

§

impl<'source> Freeze for Block<'source>

§

impl<'source> RefUnwindSafe for Block<'source>

§

impl<'source> Send for Block<'source>

§

impl<'source> !Sized for Block<'source>

§

impl<'source> Sync for Block<'source>

§

impl<'source> Unpin for Block<'source>

§

impl<'source> UnwindSafe for Block<'source>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more