Skip to main content

Reporter

Struct Reporter 

Source
pub struct Reporter<K: JobKind> { /* private fields */ }
Expand description

The handle a running job reports through.

Every method takes &self and writes into the job under the queue’s lock, so a console polling a status RPC sees a count that moves rather than a job that sits at zero for four minutes and then jumps.

Implementations§

Source§

impl<K: JobKind> Reporter<K>

Source

pub fn key(&self) -> &str

The subject this job is working on, for a runner that wants it back.

Source

pub fn progress(&self, done: u64, total: u64)

How far along, in whatever the kind counts. Overwrites the previous reading; a progress that accumulated across reports would be a second counter to keep right.

Source

pub fn report(&self, apply: impl FnOnce(&mut K::Report))

Write into the kind’s own report.

Source

pub fn snapshot(&self) -> Option<Job<K>>

The job as it stands right now, for a runner that has to read back what it reported.

The one caller is the mirror runner, which publishes an event-stream event carrying the reference list it wrote through Reporter::report. That list is on the JOB — it has to be, because a status RPC renders it — and a runner that also kept its own copy would be two places the same facts could disagree (one implementation).

None when the job is gone, which nothing does while a runner is running: a live job is never pruned.

Source§

impl Reporter<Purge>

Source

pub fn found(&self, stores: u32)

How many stores the walk found. Called once, when the walk has finished counting and before it starts unlinking.

Source

pub fn reclaimed(&self, bytes: u64)

One store is gone, and this is what it was holding.

Source

pub fn failed(&self, note: String)

One store could NOT be reclaimed, and this is why.

Recorded and the walk continues. Stopping at the first failure would leave the rest of an account that is being closed on the disk because one directory had bad permissions — and the operator would have to run the purge again anyway.

Source

pub fn principal_removed(&self)

The principal itself was removed.

Source

pub fn account(&self) -> &str

The account this purge is emptying, for a runner that wants it back.

Trait Implementations§

Source§

impl<K: JobKind> Clone for Reporter<K>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl<K> Freeze for Reporter<K>
where Arc<Inner<K>>: Freeze,

§

impl<K> RefUnwindSafe for Reporter<K>
where Arc<Inner<K>>: RefUnwindSafe,

§

impl<K> Send for Reporter<K>
where Arc<Inner<K>>: Send,

§

impl<K> Sync for Reporter<K>
where Arc<Inner<K>>: Sync,

§

impl<K> Unpin for Reporter<K>
where Arc<Inner<K>>: Unpin,

§

impl<K> UnsafeUnpin for Reporter<K>
where Arc<Inner<K>>: UnsafeUnpin,

§

impl<K> UnwindSafe for Reporter<K>
where Arc<Inner<K>>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more