Enum prql_compiler::ir::pl::TyOrExpr
source · 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, TyOrExpr>
pub fn into_ty(self) -> Result<Ty, TyOrExpr>
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<TyOrExpr, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<TyOrExpr, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for TyOrExpr
impl PartialEq for TyOrExpr
source§impl Serialize for TyOrExpr
impl Serialize for TyOrExpr
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
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