pub struct WithKind<I: Interner, T> {
pub kind: VariableKind<I>,
pub(crate) value: T,
}
Expand description
A value with an associated variable kind.
Fields§
§kind: VariableKind<I>
The associated variable kind.
value: T
The wrapped value.
Implementations§
source§impl<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§
source§impl<I: Interner> CastTo<WithKind<I, UniverseIndex>> for CanonicalVarKind<I>
impl<I: Interner> CastTo<WithKind<I, UniverseIndex>> for CanonicalVarKind<I>
source§fn 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
.source§impl<I: Interner, T> HasInterner for WithKind<I, T>
impl<I: Interner, T> HasInterner for WithKind<I, T>
source§impl<I: PartialEq + Interner, T: PartialEq> PartialEq for WithKind<I, T>
impl<I: PartialEq + Interner, T: PartialEq> PartialEq for WithKind<I, T>
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> StructuralPartialEq for WithKind<I, T>
Auto Trait Implementations§
impl<I, T> Freeze for WithKind<I, T>
impl<I, T> RefUnwindSafe for WithKind<I, T>
impl<I, T> Send for WithKind<I, T>
impl<I, T> Sync for WithKind<I, T>
impl<I, T> Unpin for WithKind<I, T>
impl<I, T> UnwindSafe for WithKind<I, T>
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: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
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
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)