Struct data_plane_api::google::api::expr::v1alpha1::SourceInfo
source · [−]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>,
}
Expand description
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 code point offsets where newlines
\n
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 code point offset
within the 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
sourceimpl Clone for SourceInfo
impl Clone for SourceInfo
sourcefn clone(&self) -> SourceInfo
fn clone(&self) -> SourceInfo
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl Debug for SourceInfo
impl Debug for SourceInfo
sourceimpl Default for SourceInfo
impl Default for SourceInfo
sourceimpl Message for SourceInfo
impl Message for SourceInfo
sourcefn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
sourcefn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
sourcefn encode_to_vec(&self) -> Vec<u8, Global>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8, Global>where
Self: Sized,
sourcefn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
sourcefn encode_length_delimited_to_vec(&self) -> Vec<u8, Global>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8, Global>where
Self: Sized,
sourcefn decode<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
fn decode<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
sourcefn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
sourcefn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
self
. Read moresourcefn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
self
. Read moresourceimpl PartialEq<SourceInfo> for SourceInfo
impl PartialEq<SourceInfo> for SourceInfo
sourcefn eq(&self, other: &SourceInfo) -> bool
fn eq(&self, other: &SourceInfo) -> bool
impl StructuralPartialEq for SourceInfo
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
sourcefn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request