pub struct RecordInit {
pub name: String,
pub name_span: ExprSpan,
pub value: Expr,
}Expand description
One required record field initializer, retaining its written name, span, and value.
§Examples
use cel_parser::{AstContext, Expr, OpLookup, Parser};
let expr = Parser::<AstContext>::new(OpLookup::new())
.parse_str_ast("Point { x: value }").unwrap();
if let Expr::Struct { fields, .. } = expr {
assert_eq!(fields[0].name, "x");
}Fields§
§name: StringThe field label, not an identifier reference.
name_span: ExprSpanThe field label token’s span.
value: ExprThe source-order value expression.
Trait Implementations§
Source§impl Clone for RecordInit
impl Clone for RecordInit
Source§fn clone(&self) -> RecordInit
fn clone(&self) -> RecordInit
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !Send for RecordInit
impl !Sync for RecordInit
impl Freeze for RecordInit
impl RefUnwindSafe for RecordInit
impl Unpin for RecordInit
impl UnsafeUnpin for RecordInit
impl UnwindSafe for RecordInit
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more