pub enum TyOrExpr {
Ty(Ty),
Expr(Box<Expr>),
}
Expand description
An expression that may have already been converted to a type.
Variants§
Implementations§
source§impl TyOrExpr
impl TyOrExpr
sourcepub fn as_ty_mut(&mut self) -> Option<&mut Ty>
pub fn as_ty_mut(&mut self) -> Option<&mut Ty>
Optionally returns mutable references to the inner fields if this is a TyOrExpr::Ty
, otherwise None
sourcepub fn as_ty(&self) -> Option<&Ty>
pub fn as_ty(&self) -> Option<&Ty>
Optionally returns references to the inner fields if this is a TyOrExpr::Ty
, otherwise None
sourcepub fn into_ty(self) -> Result<Ty, Self>
pub fn into_ty(self) -> Result<Ty, Self>
Returns the inner fields if this is a TyOrExpr::Ty
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_expr_mut(&mut self) -> Option<&mut Box<Expr>>
pub fn as_expr_mut(&mut self) -> Option<&mut Box<Expr>>
Optionally returns mutable references to the inner fields if this is a TyOrExpr::Expr
, otherwise None
Trait Implementations§
source§impl<'de> Deserialize<'de> for TyOrExpr
impl<'de> Deserialize<'de> for TyOrExpr
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for TyOrExpr
impl PartialEq for TyOrExpr
impl StructuralPartialEq for TyOrExpr
Auto Trait Implementations§
impl RefUnwindSafe for TyOrExpr
impl Send for TyOrExpr
impl Sync for TyOrExpr
impl Unpin for TyOrExpr
impl UnwindSafe for TyOrExpr
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