Enum erg_compiler::context::TyParamIdx
source · [−]pub enum TyParamIdx {
Nth(usize),
Nested {
idx: usize,
inner: Box<TyParamIdx>,
},
}
Expand description
let r = Type::mono_q("R");
let o = Type::mono_q("O");
let search_from = Type::poly("Add", vec![TyParam::t(r.clone()), TyParam::t(o.clone())]);
assert_eq!(TyParamIdx::search(&search_from, &o), Some(TyParamIdx::Nth(1)));
let i = Type::mono_q("I");
let f = Type::poly("F", vec![TyParam::t(o.clone()), TyParam::t(i.clone())]);
let search_from = Type::poly("Add", vec![TyParam::t(r), TyParam::t(f)]);
assert_eq!(TyParamIdx::search(&search_from, &o), Some(TyParamIdx::nested(1, TyParamIdx::Nth(0))));
Variants
Nth(usize)
Nested
Implementations
Trait Implementations
sourceimpl Clone for TyParamIdx
impl Clone for TyParamIdx
sourcefn clone(&self) -> TyParamIdx
fn clone(&self) -> TyParamIdx
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for TyParamIdx
impl Debug for TyParamIdx
sourceimpl Hash for TyParamIdx
impl Hash for TyParamIdx
sourceimpl PartialEq<TyParamIdx> for TyParamIdx
impl PartialEq<TyParamIdx> for TyParamIdx
sourcefn eq(&self, other: &TyParamIdx) -> bool
fn eq(&self, other: &TyParamIdx) -> bool
impl Eq for TyParamIdx
impl StructuralEq for TyParamIdx
impl StructuralPartialEq for TyParamIdx
Auto Trait Implementations
impl RefUnwindSafe for TyParamIdx
impl Send for TyParamIdx
impl Sync for TyParamIdx
impl Unpin for TyParamIdx
impl UnwindSafe for TyParamIdx
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more