Struct Arriving
pub struct Arriving<T, E = String> { /* private fields */ }Expand description
A read whose answer arrives later. Clones share one read.
Build the view with Self::view: it says what shows once the answer
is there, and nothing about waiting.
Implementations§
§impl<T, E> Arriving<T, E>
impl<T, E> Arriving<T, E>
pub fn pending(from: Source) -> Arriving<T, E>
pub fn pending(from: Source) -> Arriving<T, E>
A read asked now, its answer coming from from. Publish the answer
through Self::writer or Self::begin.
pub fn pending_since(from: Source, since: Instant) -> Arriving<T, E>
pub fn pending_since(from: Source, since: Instant) -> Arriving<T, E>
A read asked at since, its answer coming from from: for a model
that keeps when its read began and builds its view again meanwhile.
pub fn with<R>(&self, read: impl FnOnce(&Arrival<T, E>) -> R) -> R
pub fn with<R>(&self, read: impl FnOnce(&Arrival<T, E>) -> R) -> R
Where the read stands, without exposing its lock.
pub fn state(&self) -> LocalState<Arrival<T, E>>
pub fn state(&self) -> LocalState<Arrival<T, E>>
The observable state, for crate::widget::ModelView, Text or a
callback that needs the whole arrival.
pub fn revision(&self) -> u64
pub fn revision(&self) -> u64
Advances with every change of the read, for a widget that skips work while nothing changed.
pub fn clock(&self) -> Option<ArrivalClock>
pub fn clock(&self) -> Option<ArrivalClock>
The timing of the read now pending; None once it settled.
pub fn holds_frame_until(&self, now: Instant) -> Option<Instant>
pub fn holds_frame_until(&self, now: Instant) -> Option<Instant>
Until when a frame showing this read waits for it at now: while it
is a local read inside its frame budget.
pub fn retry(&self)
pub fn retry(&self)
Ask again after a failure, the way the read was first asked. A read
that set no way to retry (Self::on_retry) ignores this.
§impl<T, E> Arriving<T, E>
impl<T, E> Arriving<T, E>
pub fn writer(&self) -> ArrivalWriter<T, E>
pub fn writer(&self) -> ArrivalWriter<T, E>
A handle for a producer that publishes more than one answer (an
invocation’s updates, pages gathering). It does not restart the
read: Self::begin does.
pub fn begin(&self, from: Source) -> ArrivalCompletion<T, E>
pub fn begin(&self, from: Source) -> ArrivalCompletion<T, E>
Restart the read, its answer now coming from from: every older
completion becomes stale before the pending state is published.
pub fn load<F>(&self, from: Source, load: F) -> bool
pub fn load<F>(&self, from: Source, load: F) -> bool
Restart the read with load’s answer, run on the app runtime
(tilo_rt::app), never on the calling thread. A later restart
aborts it at its next await point.
pub fn local(
name: &'static str,
load: impl Fn() -> Result<T, E> + Send + Sync + 'static,
) -> Arriving<T, E>
pub fn local( name: &'static str, load: impl Fn() -> Result<T, E> + Send + Sync + 'static, ) -> Arriving<T, E>
A read of this device’s data: load runs on a background worker
(crate::background::Background) and a failure offers a retry that
runs it again. A host that runs no background work fails it, saying
so.
§impl<T, E> Arriving<T, E>where
T: 'static,
E: Display + 'static,
impl<T, E> Arriving<T, E>where
T: 'static,
E: Display + 'static,
pub fn view(
&self,
build: impl FnMut(&T) -> Box<dyn Widget> + 'static,
) -> ArrivingView
pub fn view( &self, build: impl FnMut(&T) -> Box<dyn Widget> + 'static, ) -> ArrivingView
The view of this read: build’s content once the answer is there.
Every placeholder and timing on the way is the framework’s
(ArrivingView).
Trait Implementations§
Auto Trait Implementations§
impl<T, E> Freeze for Arriving<T, E>
impl<T, E> RefUnwindSafe for Arriving<T, E>
impl<T, E> Send for Arriving<T, E>
impl<T, E> Sync for Arriving<T, E>
impl<T, E> Unpin for Arriving<T, E>
impl<T, E> UnsafeUnpin for Arriving<T, E>
impl<T, E> UnwindSafe for Arriving<T, E>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§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>
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>
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