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>
impl<'a> Status<'a>
Sourcepub const fn clear() -> Self
pub const fn clear() -> Self
Removes the addressed subtree, or all records when no id is supplied.
Sourcepub const fn app(self, app: AppId<'a>) -> Self
pub const fn app(self, app: AppId<'a>) -> Self
Adds a validated application identifier; repeat it on every root update.
Sourcepub const fn title(self, title: &'a str) -> Self
pub const fn title(self, title: &'a str) -> Self
Adds a single-line label, validated when sent.
Sourcepub const fn message(self, message: &'a str) -> Self
pub const fn message(self, message: &'a str) -> Self
Adds a single-line message, validated when sent.
Sourcepub const fn kind(self, kind: Kind) -> Self
pub const fn kind(self, kind: Kind) -> Self
Adds the blocking reason. Sending this on another state is an error.
Sourcepub const fn progress(self, progress: Progress) -> Self
pub const fn progress(self, progress: Progress) -> Self
Adds a percentage. Sending this outside working/blocked is an error.
Sourcepub fn write_to<W: Write + ?Sized>(self, output: &mut W) -> Result<(), Error>
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.