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
Auto 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