pub struct MaybeResolved<T, F>(/* private fields */)
where
F: IStable + Future<Output = T>,
(): IStable + IDeterminantProvider<F>,
T: IStable + IDeterminantProvider<Result<(), F>>,
Result<(), F>: IStable;Expand description
A future that may have already been resolved from the moment it was constructed.
Implementations§
Source§impl<T, F> MaybeResolved<T, F>
impl<T, F> MaybeResolved<T, F>
Sourcepub const fn has_optimal_layout() -> bool
pub const fn has_optimal_layout() -> bool
Returns true if the layout for MaybeResolved is smaller than what #[repr(C)] would have generated for it.
Source§impl<T, F> MaybeResolved<T, F>
impl<T, F> MaybeResolved<T, F>
Sourcepub fn Resolved(value: T) -> MaybeResolved<T, F> ⓘ
pub fn Resolved(value: T) -> MaybeResolved<T, F> ⓘ
The future was resolved from its construction.
Sourcepub fn Empty() -> MaybeResolved<T, F> ⓘ
pub fn Empty() -> MaybeResolved<T, F> ⓘ
The future has been consumed already.
Sourcepub fn Pending(value: F) -> MaybeResolved<T, F> ⓘ
pub fn Pending(value: F) -> MaybeResolved<T, F> ⓘ
The future is yet to be resolved.
Sourcepub fn match_owned<StabbyOut, ResolvedFn, EmptyFn, PendingFn>(
self,
Resolved: ResolvedFn,
Empty: EmptyFn,
Pending: PendingFn,
) -> StabbyOut
pub fn match_owned<StabbyOut, ResolvedFn, EmptyFn, PendingFn>( self, Resolved: ResolvedFn, Empty: EmptyFn, Pending: PendingFn, ) -> StabbyOut
Equivalent to match self.
Sourcepub fn match_ref<'st_lt, StabbyOut, ResolvedFn, EmptyFn, PendingFn>(
&'st_lt self,
Resolved: ResolvedFn,
Empty: EmptyFn,
Pending: PendingFn,
) -> StabbyOut
pub fn match_ref<'st_lt, StabbyOut, ResolvedFn, EmptyFn, PendingFn>( &'st_lt self, Resolved: ResolvedFn, Empty: EmptyFn, Pending: PendingFn, ) -> StabbyOut
Equivalent to match &self.
Sourcepub fn match_mut<StabbyOut, ResolvedFn, EmptyFn, PendingFn, 'st_lt>(
&'st_lt mut self,
Resolved: ResolvedFn,
Empty: EmptyFn,
Pending: PendingFn,
) -> StabbyOut
pub fn match_mut<StabbyOut, ResolvedFn, EmptyFn, PendingFn, 'st_lt>( &'st_lt mut self, Resolved: ResolvedFn, Empty: EmptyFn, Pending: PendingFn, ) -> StabbyOut
Equivalent to match &mut self.
Sourcepub fn match_owned_ctx<StabbyOut, StabbyCtx, ResolvedFn, EmptyFn, PendingFn>(
self,
stabby_ctx: StabbyCtx,
Resolved: ResolvedFn,
Empty: EmptyFn,
Pending: PendingFn,
) -> StabbyOut
pub fn match_owned_ctx<StabbyOut, StabbyCtx, ResolvedFn, EmptyFn, PendingFn>( self, stabby_ctx: StabbyCtx, Resolved: ResolvedFn, Empty: EmptyFn, Pending: PendingFn, ) -> StabbyOut
Equivalent to match self, but allows you to pass common arguments to all closures to make the borrow checker happy.
Sourcepub fn match_ref_ctx<'st_lt, StabbyCtx, StabbyOut, ResolvedFn, EmptyFn, PendingFn>(
&'st_lt self,
stabby_ctx: StabbyCtx,
Resolved: ResolvedFn,
Empty: EmptyFn,
Pending: PendingFn,
) -> StabbyOut
pub fn match_ref_ctx<'st_lt, StabbyCtx, StabbyOut, ResolvedFn, EmptyFn, PendingFn>( &'st_lt self, stabby_ctx: StabbyCtx, Resolved: ResolvedFn, Empty: EmptyFn, Pending: PendingFn, ) -> StabbyOut
Equivalent to match &self, but allows you to pass common arguments to all closures to make the borrow checker happy.
Sourcepub fn match_mut_ctx<StabbyCtx, StabbyOut, ResolvedFn, EmptyFn, PendingFn, 'st_lt>(
&'st_lt mut self,
stabby_ctx: StabbyCtx,
Resolved: ResolvedFn,
Empty: EmptyFn,
Pending: PendingFn,
) -> StabbyOut
pub fn match_mut_ctx<StabbyCtx, StabbyOut, ResolvedFn, EmptyFn, PendingFn, 'st_lt>( &'st_lt mut self, stabby_ctx: StabbyCtx, Resolved: ResolvedFn, Empty: EmptyFn, Pending: PendingFn, ) -> StabbyOut
Equivalent to match &mut self, but allows you to pass common arguments to all closures to make the borrow checker happy.
Trait Implementations§
Source§impl<T, F> Future for MaybeResolved<T, F>
impl<T, F> Future for MaybeResolved<T, F>
Source§impl<T, F> IStable for MaybeResolved<T, F>
impl<T, F> IStable for MaybeResolved<T, F>
Source§const REPORT: &'static TypeReport
const REPORT: &'static TypeReport
A compile-time generated report of the fields of the type, allowing for compatibility inspection.
Source§const ID: u64
const ID: u64
A stable (and ideally unique) identifier for the type. Often generated using
crate::report::gen_id, but can be manually set.Source§type ForbiddenValues = <Result<T, Result<(), F>> as IStable>::ForbiddenValues
type ForbiddenValues = <Result<T, Result<(), F>> as IStable>::ForbiddenValues
The values that the annotated type cannot occupy.
Source§type UnusedBits = <Result<T, Result<(), F>> as IStable>::UnusedBits
type UnusedBits = <Result<T, Result<(), F>> as IStable>::UnusedBits
The padding bits in the annotated types
Source§type Size = <Result<T, Result<(), F>> as IStable>::Size
type Size = <Result<T, Result<(), F>> as IStable>::Size
The size of the annotated type in bytes.
Source§type Align = <Result<T, Result<(), F>> as IStable>::Align
type Align = <Result<T, Result<(), F>> as IStable>::Align
The alignment of the annotated type in bytes.
Source§type HasExactlyOneNiche = B0
type HasExactlyOneNiche = B0
Allows the detection of whether or not
core::option::Options are stable: Read moreSource§type ContainsIndirections = <Result<T, Result<(), F>> as IStable>::ContainsIndirections
type ContainsIndirections = <Result<T, Result<(), F>> as IStable>::ContainsIndirections
Whether or not the type contains indirections (pointers, indices in independent data-structures…)
Auto Trait Implementations§
impl<T, F> Freeze for MaybeResolved<T, F>where
Result<(), F>: Sized,
(): Sized,
<<<<T as IStable>::Align as Alignment>::Max<<Result<(), F> as IStable>::Align> as IPowerOf2>::Divide<<<<<T as IDeterminantProvider<Result<(), F>>>::Determinant as IStable>::Size as IUnsigned>::NextMultipleOf<<<T as IStable>::Align as Alignment>::Max<<Result<(), F> as IStable>::Align>> as IUnsigned>::Add<<<T as IStable>::Size as IUnsigned>::Max<<Result<(), F> as IStable>::Size>>> as IUnsignedBase>::Array<<<<T as IStable>::Align as Alignment>::Max<<Result<(), F> as IStable>::Align> as Alignment>::AsUint>: Freeze,
impl<T, F> RefUnwindSafe for MaybeResolved<T, F>where
Result<(), F>: Sized,
(): Sized,
<<<<T as IStable>::Align as Alignment>::Max<<Result<(), F> as IStable>::Align> as IPowerOf2>::Divide<<<<<T as IDeterminantProvider<Result<(), F>>>::Determinant as IStable>::Size as IUnsigned>::NextMultipleOf<<<T as IStable>::Align as Alignment>::Max<<Result<(), F> as IStable>::Align>> as IUnsigned>::Add<<<T as IStable>::Size as IUnsigned>::Max<<Result<(), F> as IStable>::Size>>> as IUnsignedBase>::Array<<<<T as IStable>::Align as Alignment>::Max<<Result<(), F> as IStable>::Align> as Alignment>::AsUint>: RefUnwindSafe,
impl<T, F> Send for MaybeResolved<T, F>where
Result<(), F>: Sized,
(): Sized,
<<<<T as IStable>::Align as Alignment>::Max<<Result<(), F> as IStable>::Align> as IPowerOf2>::Divide<<<<<T as IDeterminantProvider<Result<(), F>>>::Determinant as IStable>::Size as IUnsigned>::NextMultipleOf<<<T as IStable>::Align as Alignment>::Max<<Result<(), F> as IStable>::Align>> as IUnsigned>::Add<<<T as IStable>::Size as IUnsigned>::Max<<Result<(), F> as IStable>::Size>>> as IUnsignedBase>::Array<<<<T as IStable>::Align as Alignment>::Max<<Result<(), F> as IStable>::Align> as Alignment>::AsUint>: Send,
impl<T, F> Sync for MaybeResolved<T, F>where
Result<(), F>: Sized,
(): Sized,
<<<<T as IStable>::Align as Alignment>::Max<<Result<(), F> as IStable>::Align> as IPowerOf2>::Divide<<<<<T as IDeterminantProvider<Result<(), F>>>::Determinant as IStable>::Size as IUnsigned>::NextMultipleOf<<<T as IStable>::Align as Alignment>::Max<<Result<(), F> as IStable>::Align>> as IUnsigned>::Add<<<T as IStable>::Size as IUnsigned>::Max<<Result<(), F> as IStable>::Size>>> as IUnsignedBase>::Array<<<<T as IStable>::Align as Alignment>::Max<<Result<(), F> as IStable>::Align> as Alignment>::AsUint>: Sync,
impl<T, F> Unpin for MaybeResolved<T, F>
impl<T, F> UnwindSafe for MaybeResolved<T, F>where
Result<(), F>: Sized,
(): Sized,
<<<<T as IStable>::Align as Alignment>::Max<<Result<(), F> as IStable>::Align> as IPowerOf2>::Divide<<<<<T as IDeterminantProvider<Result<(), F>>>::Determinant as IStable>::Size as IUnsigned>::NextMultipleOf<<<T as IStable>::Align as Alignment>::Max<<Result<(), F> as IStable>::Align>> as IUnsigned>::Add<<<T as IStable>::Size as IUnsigned>::Max<<Result<(), F> as IStable>::Size>>> as IUnsignedBase>::Array<<<<T as IStable>::Align as Alignment>::Max<<Result<(), F> as IStable>::Align> as Alignment>::AsUint>: UnwindSafe,
Blanket Implementations§
Source§impl<Source> AccessAs for Source
impl<Source> AccessAs for Source
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<F> IntoFuture for Fwhere
F: Future,
impl<F> IntoFuture for Fwhere
F: Future,
Source§type IntoFuture = F
type IntoFuture = F
Which kind of future are we turning this into?
Source§fn into_future(self) -> <F as IntoFuture>::IntoFuture
fn into_future(self) -> <F as IntoFuture>::IntoFuture
Creates a future from a value. Read more