Struct moore_common::source::Spanned [] [src]

pub struct Spanned<T> {
    pub value: T,
    pub span: Span,
}

A wrapper that associates a span with a value.

Fields

Methods

impl<T> Spanned<T>
[src]

[src]

Wrap a given value together with the span it covers.

[src]

Map the spanned value, preserving the span.

[src]

[src]

Trait Implementations

impl<T: PartialOrd> PartialOrd for Spanned<T>
[src]

[src]

This method returns an ordering between self and other values if one exists. Read more

[src]

This method tests less than (for self and other) and is used by the < operator. Read more

[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<T: Ord> Ord for Spanned<T>
[src]

[src]

This method returns an Ordering between self and other. Read more

1.22.0
[src]

Compares and returns the maximum of two values. Read more

1.22.0
[src]

Compares and returns the minimum of two values. Read more

impl<T: PartialEq> PartialEq for Spanned<T>
[src]

[src]

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

[src]

This method tests for !=.

impl<T: Eq> Eq for Spanned<T>
[src]

impl<T: Encodable> Encodable for Spanned<T>
[src]

[src]

Serialize a value using an Encoder.

impl<T: Decodable> Decodable for Spanned<T>
[src]

[src]

Deserialize a value using a Decoder.

impl<T> Debug for Spanned<T> where
    T: Debug
[src]

[src]

Formats the value using the given formatter.

impl<T> Copy for Spanned<T> where
    T: Copy
[src]

impl<T> Clone for Spanned<T> where
    T: Clone
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T> HasSpan for Spanned<T>
[src]

[src]

Obtain the full span of the input file that this node covers.

[src]

Obtain a span which can be used to refer to this node in error messages presented to humans. This will generally be the name for things like entities, processes, and variables. Defaults to return whatever span() returns. Read more

impl<T> HasDesc for Spanned<T> where
    T: HasDesc
[src]

[src]

Obtain a human-readable descriptive name for this node.