Struct gapi_grpc::google::api::expr::v1alpha1::SourceInfo[][src]

pub struct SourceInfo {
    pub syntax_version: String,
    pub location: String,
    pub line_offsets: Vec<i32>,
    pub positions: HashMap<i64, i32>,
    pub macro_calls: HashMap<i64, Expr>,
}

Source information collected at parse time.

Fields

syntax_version: String

The syntax version of the source, e.g. cel1.

location: String

The location name. All position information attached to an expression is relative to this location.

The location could be a file, UI element, or similar. For example, acme/app/AnvilPolicy.cel.

line_offsets: Vec<i32>

Monotonically increasing list of character offsets where newlines appear.

The line number of a given position is the index i where for a given id the line_offsets[i] < id_positions[id] < line_offsets[i+1]. The column may be derivd from id_positions[id] - line_offsets[i].

positions: HashMap<i64, i32>

A map from the parse node id (e.g. Expr.id) to the character offset within source.

macro_calls: HashMap<i64, Expr>

A map from the parse node id where a macro replacement was made to the call Expr that resulted in a macro expansion.

For example, has(value.field) is a function call that is replaced by a test_only field selection in the AST. Likewise, the call list.exists(e, e > 10) translates to a comprehension expression. The key in the map corresponds to the expression id of the expanded macro, and the value is the call Expr that was replaced.

Trait Implementations

impl Clone for SourceInfo[src]

impl Debug for SourceInfo[src]

impl Default for SourceInfo[src]

impl Message for SourceInfo[src]

impl PartialEq<SourceInfo> for SourceInfo[src]

impl StructuralPartialEq for SourceInfo[src]

Auto Trait Implementations

impl RefUnwindSafe for SourceInfo

impl Send for SourceInfo

impl Sync for SourceInfo

impl Unpin for SourceInfo

impl UnwindSafe for SourceInfo

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoRequest<T> for T[src]

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

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]

impl<T> WithSubscriber for T[src]