pub struct Upkeep { /* private fields */ }Expand description
What a view keeps up beside its widgets. See the module docs. Each source is asked whenever the window asks its widgets the same, so it reads the view’s state as it is then.
Implementations§
Source§impl Upkeep
impl Upkeep
pub fn new() -> Self
Sourcepub fn syncing(self, sync: impl FnMut() + 'static) -> Self
pub fn syncing(self, sync: impl FnMut() + 'static) -> Self
Run sync on every sync of the window, before the view’s widgets
sync: take in what work finished, move the view’s state, so the
parts keyed by it are built again in the same frame.
Sourcepub fn busy(self, busy: impl Fn() -> bool + 'static) -> Self
pub fn busy(self, busy: impl Fn() -> bool + 'static) -> Self
Whether work the view runs is under way that the window keeps drawing frames for while it lasts.
Sourcepub fn next_wake(self, next: impl Fn() -> Option<Instant> + 'static) -> Self
pub fn next_wake(self, next: impl Fn() -> Option<Instant> + 'static) -> Self
When the view next wants a sync while nothing else happens (a read on a timer, a notice that expires).
Sourcepub fn pending_visual_work(self, pending: impl Fn() -> bool + 'static) -> Self
pub fn pending_visual_work(self, pending: impl Fn() -> bool + 'static) -> Self
Whether what the view shows is still on its way (a first reading): a still capture waits for it, and a live window asks no frames on its account.
Sourcepub fn presenting(self, presented: impl FnMut() + 'static) -> Self
pub fn presenting(self, presented: impl FnMut() + 'static) -> Self
Run presented after each frame the view draws.
Sourcepub fn appearance(
self,
appearance: impl Fn() -> Option<AppearanceIntent> + 'static,
) -> Self
pub fn appearance( self, appearance: impl Fn() -> Option<AppearanceIntent> + 'static, ) -> Self
The look the window shows itself in while appearance says one (a
page that changes the look shows it the instant it changes); the
host applies what differs.
Sourcepub fn collaboration(
self,
take: impl FnMut() -> Vec<CollabRequest> + 'static,
handle: impl FnMut(&CollabEvent) + 'static,
) -> Self
pub fn collaboration( self, take: impl FnMut() -> Vec<CollabRequest> + 'static, handle: impl FnMut(&CollabEvent) + 'static, ) -> Self
Share the app’s collaboration connection with the view’s host
actions: take drains what they ask the collaboration host, and
handle hands them each event it answers with.
Sourcepub fn kept_view(
self,
app_id: impl Into<String>,
version: u32,
capture: impl Fn() -> Vec<u8> + 'static,
restore: impl FnMut(&[u8]) -> Result<(), String> + 'static,
) -> Self
pub fn kept_view( self, app_id: impl Into<String>, version: u32, capture: impl Fn() -> Vec<u8> + 'static, restore: impl FnMut(&[u8]) -> Result<(), String> + 'static, ) -> Self
Keep what capture says of the view’s presentation (the page it
shows) with the window, as the app app_id at version: a reopened
window hands it to restore, which refuses what it cannot show.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Upkeep
impl !RefUnwindSafe for Upkeep
impl !Send for Upkeep
impl !Sync for Upkeep
impl Unpin for Upkeep
impl UnsafeUnpin for Upkeep
impl !UnwindSafe for Upkeep
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
§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> 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