pub struct OperationProgress { /* private fields */ }ui only.Expand description
A region that follows an operation. See the module for how a page uses it.
use navree_queue::ui::OperationProgress;
use navree_ui::render;
use uuid::Uuid;
let id = Uuid::now_v7();
let html = render(&OperationProgress::new(id).into());
assert!(html.contains(&format!(r#"data-ui-src="/operations/{id}/progress""#)));
assert!(html.contains("data-ui-poll"));
assert!(html.contains("Waiting to start"));Implementations§
Source§impl OperationProgress
impl OperationProgress
Sourcepub fn new(id: Uuid) -> Self
pub fn new(id: Uuid) -> Self
The progress of operation id, fetched from the fragment QueueModule serves.
Sourcepub fn src(self, src: impl Into<Href>) -> Self
pub fn src(self, src: impl Into<Href>) -> Self
Fetches the fragment from src instead (a route of your own).
Sourcepub fn poll(self, every: Duration) -> Self
pub fn poll(self, every: Duration) -> Self
Asks again this often while the operation is unfinished (2 seconds by default).
Sourcepub fn live(self) -> Self
pub fn live(self) -> Self
Also hears the operation change on the app’s live hub, so the region fetches as
soon as something happened rather than at the next poll. It needs RealtimeModule;
without it the region only polls.
Sourcepub fn live_on(self, stream: LiveStream) -> Self
pub fn live_on(self, stream: LiveStream) -> Self
live on a stream of your own, which must carry the topic
operation_topic.
Sourcepub fn labels(self, labels: OperationLabels) -> Self
pub fn labels(self, labels: OperationLabels) -> Self
Sets the words.
Sourcepub fn result_key(self, key: impl Into<String>) -> Self
pub fn result_key(self, key: impl Into<String>) -> Self
Reads the link to the result from this key of the operation’s result (url by
default). Only an address on this site becomes a link.
Sourcepub fn record(self, record: OperationRecord) -> Self
pub fn record(self, record: OperationRecord) -> Self
Draws the operation as it is now, the way the fragment answers.
Trait Implementations§
Source§impl Clone for OperationProgress
impl Clone for OperationProgress
Source§impl Debug for OperationProgress
impl Debug for OperationProgress
Source§impl From<OperationProgress> for Node
impl From<OperationProgress> for Node
Source§fn from(progress: OperationProgress) -> Self
fn from(progress: OperationProgress) -> Self
Auto Trait Implementations§
impl Forget for OperationProgress
impl Freeze for OperationProgress
impl RefUnwindSafe for OperationProgress
impl Send for OperationProgress
impl Sync for OperationProgress
impl Unpin for OperationProgress
impl UnsafeUnpin for OperationProgress
impl UnwindSafe for OperationProgress
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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