pub struct Code {
    pub value: RefCell<String>,
    pub start_line_number: NonZeroU64,
    pub source: Source,
}
Expand description

Source code fragment

An instance of Code contains a block of the source code that was parsed to produce an AST.

Fields

value: RefCell<String>

Content of the code, usually terminated by a newline.

The value is contained in a RefCell so that more lines can be appended to the value as the parser reads input lines.

start_line_number: NonZeroU64

Line number of the first line of the code. Counted from 1.

source: Source

Source of this code.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.