pub struct Expr {
pub attrs: Vec<AttributeItem>,
pub kind: ExprKind,
}Fields§
§attrs: Vec<AttributeItem>§kind: ExprKindImplementations§
source§impl Expr
impl Expr
pub fn new(kind: impl Into<ExprKind>) -> Self
pub fn add_attr(&mut self, attr: AttributeItem)
pub fn remove_attr(&mut self, attr: &AttributeItem)
pub fn is_compound(&self) -> bool
source§impl Expr
impl Expr
pub fn call(self, args: Vec<Expr>) -> Self
pub fn method_call(self, seg: PathSegment, args: Vec<Expr>) -> Self
pub fn cast(self, ty: impl Into<Type>) -> Self
pub fn field(self, ident: impl Into<String>) -> Self
pub fn index(self, index: impl Into<Expr>) -> Self
pub fn await_(self) -> Self
pub fn try_(self) -> Self
Trait Implementations§
source§impl From<Expr> for TokenStream
impl From<Expr> for TokenStream
source§impl PartialEq for Expr
impl PartialEq for Expr
impl Eq for Expr
impl StructuralEq for Expr
impl StructuralPartialEq for Expr
Auto Trait Implementations§
impl RefUnwindSafe for Expr
impl Send for Expr
impl Sync for Expr
impl Unpin for Expr
impl UnwindSafe for Expr
Blanket Implementations§
source§impl<E> Accessible for Ewhere
E: Into<Expr>,
impl<E> Accessible for Ewhere E: Into<Expr>,
source§impl<E> Assignable for Ewhere
E: Into<Expr>,
impl<E> Assignable for Ewhere E: Into<Expr>,
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