Skip to main content

OnCore

Struct OnCore 

Source
pub struct OnCore<'rt, R: ?Sized> { /* private fields */ }
Expand description

Placement bound. Every stage is complete on its own — the default it replaces is a real value, not an absent one.

Implementations§

Source§

impl<'rt, R: Runtime + ?Sized> OnCore<'rt, R>

Source

pub fn spawn<F>(self, future: F) -> Result<(), SpawnError>
where F: Future<Output = ()> + Send + 'static,

Spawn a Send future on the first candidate. A future can only be spawned once, so this does not fall through on back-pressure — use Self::spawn_with when the placement has more than one candidate.

Source

pub fn spawn_with<Factory, F, Decide>( self, factory: Factory, decide: Decide, ) -> Result<CoreId, Exhausted>
where Factory: Fn() -> F, F: Future<Output = ()> + Send + 'static, Decide: FnMut(u32, &SpawnError) -> bool,

Spawn from a factory, letting the caller decide whether to keep going.

InboxFull drops the future, so recovering means rebuilding it — hence the factory. What it does not do is decide policy: no delay, no jitter, no attempt cap live here. decide is called with the 0-based attempt and the error, and returning true moves to the next candidate.

That split is deliberate. RetryController (backoff, jitter, deadline, RetryRules) lives in proxima-primitives, which depends on this crate — so this crate cannot reach it, and baking a policy in here would fork it. Passing the decision in means a caller composes with whatever it already holds at its own layer, and decide being a plain FnMut rather than a trait keeps that composition free.

Auto Trait Implementations§

§

impl<'rt, R> Freeze for OnCore<'rt, R>
where &'rt R: Freeze, R: ?Sized,

§

impl<'rt, R> RefUnwindSafe for OnCore<'rt, R>

§

impl<'rt, R> Send for OnCore<'rt, R>
where &'rt R: Send, R: ?Sized,

§

impl<'rt, R> Sync for OnCore<'rt, R>
where &'rt R: Sync, R: ?Sized,

§

impl<'rt, R> Unpin for OnCore<'rt, R>
where &'rt R: Unpin, R: ?Sized,

§

impl<'rt, R> UnsafeUnpin for OnCore<'rt, R>
where &'rt R: UnsafeUnpin, R: ?Sized,

§

impl<'rt, R> UnwindSafe for OnCore<'rt, R>
where &'rt R: UnwindSafe, R: ?Sized,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.