Struct parallel_disk_usage::reporter::progress_and_error_reporter::ProgressAndErrorReporter[][src]

pub struct ProgressAndErrorReporter<Data, ReportError> where
    Data: Size + Send + Sync,
    ReportError: Fn(ErrorReport<'_>) + Sync
{ /* fields omitted */ }
Expand description

Store progress information and call report function on said information.

NOTE: If an error occurred, report_error would be called before report_progress.

Implementations

impl<Data, ReportError> ProgressAndErrorReporter<Data, ReportError> where
    Data: Size + Send + Sync,
    ReportError: Fn(ErrorReport<'_>) + Sync
[src]

pub fn new<ReportProgress>(
    report_progress: ReportProgress,
    progress_report_interval: Duration,
    report_error: ReportError
) -> Self where
    ProgressReport<Data>: Default + 'static,
    ReportProgress: Fn(ProgressReport<Data>) + Send + Sync + 'static, 
[src]

Create a new ProgressAndErrorReporter from a report function.

pub fn stop_progress_reporter(&self)[src]

Stop the thread that reports progress.

This function would be automatically invoked once the value is dropped.

Trait Implementations

impl<Data: Debug, ReportError: Debug> Debug for ProgressAndErrorReporter<Data, ReportError> where
    Data: Size + Send + Sync,
    ReportError: Fn(ErrorReport<'_>) + Sync
[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl<Data, ReportError> ParallelReporter<Data> for ProgressAndErrorReporter<Data, ReportError> where
    Data: Size + Send + Sync,
    ReportError: Fn(ErrorReport<'_>) + Sync
[src]

type DestructionError = Box<dyn Any + Send + 'static>

Error type of the destroy method.

fn destroy(self) -> Result<(), Self::DestructionError>[src]

Stop all threads.

impl<Data, ReportError> Reporter<Data> for ProgressAndErrorReporter<Data, ReportError> where
    Data: Size + Send + Sync,
    ReportError: Fn(ErrorReport<'_>) + Sync
[src]

fn report(&self, event: Event<'_, Data>)[src]

Handle report event.

Auto Trait Implementations

impl<Data, ReportError> !RefUnwindSafe for ProgressAndErrorReporter<Data, ReportError>

impl<Data, ReportError> Send for ProgressAndErrorReporter<Data, ReportError> where
    ReportError: Send

impl<Data, ReportError> Sync for ProgressAndErrorReporter<Data, ReportError>

impl<Data, ReportError> Unpin for ProgressAndErrorReporter<Data, ReportError> where
    ReportError: Unpin

impl<Data, ReportError> !UnwindSafe for ProgressAndErrorReporter<Data, ReportError>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<X> Pipe for X[src]

fn pipe<Return, Function>(self, f: Function) -> Return where
    Function: FnOnce(Self) -> Return, 
[src]

Apply f to self. Read more

fn pipe_ref<'a, Return, Function>(&'a self, f: Function) -> Return where
    Function: FnOnce(&'a Self) -> Return, 
[src]

Apply f to &self. Read more

fn pipe_mut<'a, Return, Function>(&'a mut self, f: Function) -> Return where
    Function: FnOnce(&'a mut Self) -> Return, 
[src]

Apply f to &mut self. Read more

impl<X> Pipe for X[src]

fn pipe<Return, Function>(self, f: Function) -> Return where
    Function: FnOnce(Self) -> Return, 
[src]

Apply f to self. Read more

fn pipe_ref<'a, Return, Function>(&'a self, f: Function) -> Return where
    Function: FnOnce(&'a Self) -> Return, 
[src]

Apply f to &self. Read more

fn pipe_mut<'a, Return, Function>(&'a mut self, f: Function) -> Return where
    Function: FnOnce(&'a mut Self) -> Return, 
[src]

Apply f to &mut self. Read more

fn pipe_as_ref<'a, Param, Return, Function>(&'a self, f: Function) -> Return where
    Self: AsRef<Param>,
    Param: 'a + ?Sized,
    Function: FnOnce(&'a Param) -> Return, 
[src]

Apply f to &self where f takes a single parameter of type Param and Self implements trait AsRef<Param>. Read more

fn pipe_as_mut<'a, Param, Return, Function>(&'a mut self, f: Function) -> Return where
    Self: AsMut<Param>,
    Param: 'a + ?Sized,
    Function: FnOnce(&'a mut Param) -> Return, 
[src]

Apply f to &mut self where f takes a single parameter of type Param and Self implements trait AsMut<Param>. Read more

fn pipe_deref<'a, Param, Return, Function>(&'a self, f: Function) -> Return where
    Self: Deref<Target = Param>,
    Param: 'a + ?Sized,
    Function: FnOnce(&'a Param) -> Return, 
[src]

Apply f to &self where f takes a single parameter of type Param and Self implements trait Deref<Param>. Read more

fn pipe_deref_mut<'a, Param, Return, Function>(
    &'a mut self,
    f: Function
) -> Return where
    Self: DerefMut<Target = Param>,
    Param: 'a + ?Sized,
    Function: FnOnce(&'a mut Param) -> Return, 
[src]

Apply f to &mut self where f takes a single parameter of type Param and Self implements trait DerefMut<Param>. Read more

fn pipe_borrow<'a, Param, Return, Function>(&'a self, f: Function) -> Return where
    Self: Borrow<Param>,
    Param: 'a + ?Sized,
    Function: FnOnce(&'a Param) -> Return, 
[src]

Apply f to &self where f takes a single parameter of type Param and Self implements trait Deref<Param>. Read more

fn pipe_borrow_mut<'a, Param, Return, Function>(
    &'a mut self,
    f: Function
) -> Return where
    Self: BorrowMut<Param>,
    Param: 'a + ?Sized,
    Function: FnOnce(&'a mut Param) -> Return, 
[src]

Apply f to &mut self where f takes a single parameter of type Param and Self implements trait DerefMut<Param>. Read more

impl<T> Pointable for T

pub const ALIGN: usize

The alignment of pointer.

type Init = T

The type for initializers.

pub unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more

pub unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more

pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more

pub unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.