pub struct RedBound<'env, 'db> {
env: &'env Env<'db>,
infer: InferVarIndex,
direction: Direction,
compiler_location: &'static Location<'static>,
}Expand description
Accessor for the bounding red-ty or red-perm on an inference variable. Can be used to read or modify the current values but can also be awaited through impl, which will block until a value is set by another task. Note that red-ty bounds can be set more than once but must always get tighter each time they are modified.
Fields§
§env: &'env Env<'db>§infer: InferVarIndex§direction: Direction§compiler_location: &'static Location<'static>Implementations§
Source§impl<'env, 'db> RedBound<'env, 'db>
impl<'env, 'db> RedBound<'env, 'db>
Sourcepub fn peek_ty(self) -> Option<(RedTy<'db>, ArcOrElse<'db>)>
pub fn peek_ty(self) -> Option<(RedTy<'db>, ArcOrElse<'db>)>
Read the current value of the bound
Sourcepub fn set_ty(self, red_ty: RedTy<'db>, or_else: &dyn OrElse<'db>)
pub fn set_ty(self, red_ty: RedTy<'db>, or_else: &dyn OrElse<'db>)
Modify the current value of the bound
Sourcepub fn ty(self) -> impl Future<Output = Option<(RedTy<'db>, ArcOrElse<'db>)>>
pub fn ty(self) -> impl Future<Output = Option<(RedTy<'db>, ArcOrElse<'db>)>>
Convert to a future that blocks until the red-ty future is set
Auto Trait Implementations§
impl<'env, 'db> Freeze for RedBound<'env, 'db>
impl<'env, 'db> !RefUnwindSafe for RedBound<'env, 'db>
impl<'env, 'db> !Send for RedBound<'env, 'db>
impl<'env, 'db> !Sync for RedBound<'env, 'db>
impl<'env, 'db> Unpin for RedBound<'env, 'db>
impl<'env, 'db> UnsafeUnpin for RedBound<'env, 'db>
impl<'env, 'db> !UnwindSafe for RedBound<'env, 'db>
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more