pub struct WithKind<I: Interner, T> {
pub kind: VariableKind<I>,
/* private fields */
}
Expand description
A value with an associated variable kind.
Fields
kind: VariableKind<I>
The associated variable kind.
Implementations
sourceimpl<I: Interner, T> WithKind<I, T>
impl<I: Interner, T> WithKind<I, T>
sourcepub fn new(kind: VariableKind<I>, value: T) -> Self
pub fn new(kind: VariableKind<I>, value: T) -> Self
Creates a WithKind
from a variable kind and a value.
sourcepub fn map<U, OP>(self, op: OP) -> WithKind<I, U> where
OP: FnOnce(T) -> U,
pub fn map<U, OP>(self, op: OP) -> WithKind<I, U> where
OP: FnOnce(T) -> U,
Maps the value in WithKind
.
Trait Implementations
sourceimpl<I: Interner> CastTo<WithKind<I, UniverseIndex>> for CanonicalVarKind<I>
impl<I: Interner> CastTo<WithKind<I, UniverseIndex>> for CanonicalVarKind<I>
sourcefn cast_to(
self,
_interner: <CanonicalVarKind<I> as HasInterner>::Interner
) -> CanonicalVarKind<I>
fn cast_to(
self,
_interner: <CanonicalVarKind<I> as HasInterner>::Interner
) -> CanonicalVarKind<I>
Cast a value to type T
.
sourceimpl<I: Interner, T> From<WithKind<I, T>> for (VariableKind<I>, T)
impl<I: Interner, T> From<WithKind<I, T>> for (VariableKind<I>, T)
sourceimpl<I: Interner, T> HasInterner for WithKind<I, T>
impl<I: Interner, T> HasInterner for WithKind<I, T>
type Interner = I
type Interner = I
The interner associated with the type.
impl<I: Interner, T: Copy> Copy for WithKind<I, T> where
I::InternedType: Copy,
impl<I: Eq + Interner, T: Eq> Eq for WithKind<I, T>
impl<I: Interner, T> StructuralEq for WithKind<I, T>
impl<I: Interner, T> StructuralPartialEq for WithKind<I, T>
Auto Trait Implementations
impl<I, T> RefUnwindSafe for WithKind<I, T> where
T: RefUnwindSafe,
<I as Interner>::InternedType: RefUnwindSafe,
impl<I, T> Send for WithKind<I, T> where
T: Send,
<I as Interner>::InternedType: Send,
impl<I, T> Sync for WithKind<I, T> where
T: Sync,
<I as Interner>::InternedType: Sync,
impl<I, T> Unpin for WithKind<I, T> where
T: Unpin,
<I as Interner>::InternedType: Unpin,
impl<I, T> UnwindSafe for WithKind<I, T> where
T: UnwindSafe,
<I as Interner>::InternedType: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<T> Cast for T
impl<T> Cast for T
sourcefn cast<U>(self, interner: U::Interner) -> U where
Self: CastTo<U>,
U: HasInterner,
fn cast<U>(self, interner: U::Interner) -> U where
Self: CastTo<U>,
U: HasInterner,
Cast a value to type U
using CastTo
.