pub struct PageLifetime { /* private fields */ }Expand description
PageLifetime enables a page to automatically switch to another page after a certain time.
The page lifetime is only applied while a page is presented. Each page type is responsible to care if page lifetime is to be considered. Page lifetime is measured in update events. I.e. an update event shall cause a call to increase_age.
Implementations§
Source§impl PageLifetime
impl PageLifetime
pub fn new(target: PageNavigation, lifetime_in_updates: u16) -> Self
Sourcepub fn get_target(&self) -> PageNavigation
pub fn get_target(&self) -> PageNavigation
Where to navigate to if lifetime is over
Sourcepub fn increase_age(&mut self)
pub fn increase_age(&mut self)
Increase page age - to be called by page if it receives page update event.
Trait Implementations§
Source§impl Clone for PageLifetime
impl Clone for PageLifetime
Source§fn clone(&self) -> PageLifetime
fn clone(&self) -> PageLifetime
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for PageLifetime
Auto Trait Implementations§
impl Freeze for PageLifetime
impl RefUnwindSafe for PageLifetime
impl Send for PageLifetime
impl Sync for PageLifetime
impl Unpin for PageLifetime
impl UnwindSafe for PageLifetime
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