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 fn name_mut(&mut self) -> Option<&mut Str>
pub const fn typ(&self) -> &Type
pub const fn default_typ(&self) -> Option<&Type>
pub fn typ_mut(&mut self) -> &mut Type
pub fn default_typ_mut(&mut self) -> Option<&mut Type>
pub fn map_type(self, f: &mut impl FnMut(Type) -> Type) -> Self
pub fn map_default_type(self, f: &mut impl FnMut(Type) -> Type) -> Self
pub fn try_map_type<E>( self, f: &mut impl FnMut(Type) -> Result<Type, E>, ) -> Result<Self, E>
pub fn try_map_default_type<E>( self, f: &mut impl FnMut(Type) -> Result<Type, E>, ) -> Result<Self, E>
pub fn deconstruct(self) -> (Option<Str>, Type, Option<Type>)
Trait Implementations§
impl Eq for ParamTy
impl StructuralPartialEq for ParamTy
Auto Trait Implementations§
impl Freeze for ParamTy
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)