Enum erg_compiler::ty::ParamTy
source · pub enum ParamTy {
Pos(Type),
Kw {
name: Str,
ty: Type,
},
KwWithDefault {
name: Str,
ty: Type,
default: Type,
},
}
Variants§
Implementations§
source§impl ParamTy
impl ParamTy
pub fn kw(name: Str, ty: Type) -> Self
pub fn pos_or_kw(name: Option<Str>, ty: Type) -> Self
pub const fn kw_default(name: Str, ty: Type, default: Type) -> Self
pub fn name(&self) -> Option<&Str>
pub const fn typ(&self) -> &Type
pub fn typ_mut(&mut self) -> &mut Type
pub fn map_type<F>(self, f: F) -> Selfwhere F: FnOnce(Type) -> Type,
pub fn try_map_type<F, E>(self, f: F) -> Result<Self, E>where F: FnOnce(Type) -> Result<Type, E>,
pub fn deconstruct(self) -> (Option<Str>, Type, Option<Type>)
Trait Implementations§
source§impl PartialEq<ParamTy> for ParamTy
impl PartialEq<ParamTy> for ParamTy
impl Eq for ParamTy
impl StructuralEq for ParamTy
impl StructuralPartialEq for ParamTy
Auto Trait Implementations§
impl RefUnwindSafe for ParamTy
impl Send for ParamTy
impl Sync for ParamTy
impl Unpin for ParamTy
impl UnwindSafe for ParamTy
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