Skip to main content

Status

Struct Status 

Source
pub struct Status<'a> { /* private fields */ }
Expand description

Plain-text report to encode. None means absent, not “keep prior value”.

Implementations§

Source§

impl<'a> Status<'a>

Source

pub const fn new(state: State) -> Self

Begins a complete replacement for the root record.

Source

pub const fn clear() -> Self

Removes the addressed subtree, or all records when no id is supplied.

Source

pub const fn id(self, id: RecordId<'a>) -> Self

Addresses a validated child record.

Source

pub const fn app(self, app: AppId<'a>) -> Self

Adds a validated application identifier; repeat it on every root update.

Source

pub const fn title(self, title: &'a str) -> Self

Adds a single-line label, validated when sent.

Source

pub const fn message(self, message: &'a str) -> Self

Adds a single-line message, validated when sent.

Source

pub const fn kind(self, kind: Kind) -> Self

Adds the blocking reason. Sending this on another state is an error.

Source

pub const fn progress(self, progress: Progress) -> Self

Adds a percentage. Sending this outside working/blocked is an error.

Source

pub fn write_to<W: Write + ?Sized>(self, output: &mut W) -> Result<(), Error>

Encodes a complete report and writes it through the caller’s writer. This method does not flush the writer.

§Errors

Returns a validation error before writing if text is invalid or fields are incompatible with the state. Returns an I/O error if writing fails; I/O failures can leave a partial frame, as with any write_all operation.

Trait Implementations§

Source§

impl<'a> Clone for Status<'a>

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
Source§

impl<'a> Copy for Status<'a>

Source§

impl<'a> Debug for Status<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Status<'a>

§

impl<'a> RefUnwindSafe for Status<'a>

§

impl<'a> Send for Status<'a>

§

impl<'a> Sync for Status<'a>

§

impl<'a> Unpin for Status<'a>

§

impl<'a> UnsafeUnpin for Status<'a>

§

impl<'a> UnwindSafe for Status<'a>

Blanket Implementations§

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<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<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, 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> 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.