pub struct ClientReporter { /* private fields */ }Expand description
Lightweight client-side handle for sending updates into the store.
This type is intended to be cloned and moved across threads without carrying any store internals.
Implementations§
Source§impl ClientReporter
impl ClientReporter
Sourcepub fn new(tx: Sender<ClientState>) -> Self
pub fn new(tx: Sender<ClientState>) -> Self
Create a reporter from a sender that feeds the store.
Sourcepub fn report(&self, state: ClientState) -> Result<(), ReportError>
pub fn report(&self, state: ClientState) -> Result<(), ReportError>
Send a raw ClientState update to the store.
This is the lowest-level API; most users should prefer start
and the ClientHandle methods.
Sourcepub fn start(
&self,
label: impl Into<String>,
total: Option<u64>,
) -> Result<ClientHandle, ReportError>
pub fn start( &self, label: impl Into<String>, total: Option<u64>, ) -> Result<ClientHandle, ReportError>
Start a new client/task and return a handle for future updates.
This sends an initial full state (including label and optional total) and returns a handle that emits partial updates afterwards.
Trait Implementations§
Source§impl Clone for ClientReporter
impl Clone for ClientReporter
Source§fn clone(&self) -> ClientReporter
fn clone(&self) -> ClientReporter
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 moreAuto Trait Implementations§
impl Freeze for ClientReporter
impl RefUnwindSafe for ClientReporter
impl Send for ClientReporter
impl Sync for ClientReporter
impl Unpin for ClientReporter
impl UnwindSafe for ClientReporter
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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