Struct gcode::Span[][src]

#[repr(C)]
pub struct Span { pub start: usize, pub end: usize, pub source_line: usize, }

A set of byte indices which correspond to the location of a substring in a larger piece of text.

The indices are set up such that &original_text[start .. end] will yield the selected text.

Fields

The starting index.

The index one past the end of the selected text.

Which line (zero indexed) does the text start on?

Methods

impl Span
[src]

Create a new Span.

Get the union of two spans.

The number of bytes within this span.

Given the original text, retrieve the substring this Span corresponds to.

Trait Implementations

impl Debug for Span
[src]

Formats the value using the given formatter. Read more

impl Default for Span
[src]

Returns the "default value" for a type. Read more

impl Copy for Span
[src]

impl Clone for Span
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for Span
[src]

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

This method tests for !=.

impl Eq for Span
[src]

impl Hash for Span
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

Auto Trait Implementations

impl Send for Span

impl Sync for Span