pub struct Builder<T, E> { /* private fields */ }
Expand description
Construct the settings around how a Refreshed should be created and updated.
Implementations§
Source§impl<T, E> Builder<T, E>
impl<T, E> Builder<T, E>
Sourcepub fn duration(&mut self, duration: Duration) -> &mut Self
pub fn duration(&mut self, duration: Duration) -> &mut Self
Set the duration for refreshing. Default value: 60 seconds.
Sourcepub fn error(&mut self, error: impl Fn(&E) + Send + Sync + 'static) -> &mut Self
pub fn error(&mut self, error: impl Fn(&E) + Send + Sync + 'static) -> &mut Self
What should we do with error values produced while refreshing? Default: no action.
Sourcepub fn success(
&mut self,
success: impl Fn(&T) + Send + Sync + 'static,
) -> &mut Self
pub fn success( &mut self, success: impl Fn(&T) + Send + Sync + 'static, ) -> &mut Self
What should we do with success values produced while refreshing? Default: no action.
Sourcepub fn exit(&mut self, exit: impl Fn() + Send + Sync + 'static) -> &mut Self
pub fn exit(&mut self, exit: impl Fn() + Send + Sync + 'static) -> &mut Self
What should we do when the refresh loop exits? Default: debug level log message.
Source§impl<T> Builder<T, Infallible>
impl<T> Builder<T, Infallible>
Trait Implementations§
Auto Trait Implementations§
impl<T, E> Freeze for Builder<T, E>
impl<T, E> !RefUnwindSafe for Builder<T, E>
impl<T, E> Send for Builder<T, E>
impl<T, E> Sync for Builder<T, E>
impl<T, E> Unpin for Builder<T, E>
impl<T, E> !UnwindSafe for Builder<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
Mutably borrows from an owned value. Read more