pub struct Context<'a> { /* private fields */ }Expand description
Borrowed fields to repeat in each report for a record.
status starts a fresh complete replacement with this app,
id, and title. Each report starts without a message, progress, or blocking kind.
Creating a context or a report does not allocate or write output.
Implementations§
Source§impl<'a> Context<'a>
impl<'a> Context<'a>
Sourcepub const fn id(self, id: RecordId<'a>) -> Self
pub const fn id(self, id: RecordId<'a>) -> Self
Addresses this validated child record in each report.
Sourcepub const fn app(self, app: AppId<'a>) -> Self
pub const fn app(self, app: AppId<'a>) -> Self
Repeats this validated application identifier in each report.
Sourcepub const fn title(self, title: &'a str) -> Self
pub const fn title(self, title: &'a str) -> Self
Repeats this single-line label, validated when a report is sent.
Sourcepub const fn status(&self, state: State) -> Status<'a>
pub const fn status(&self, state: State) -> Status<'a>
Begins a fresh report with the context’s app, id, and title.
The report borrows the original fields independently of this context.
Its setters can override those fields without changing subsequent reports.
Validation and output happen in Status::write_to.
Trait Implementations§
impl<'a> Copy for Context<'a>
Auto Trait Implementations§
impl<'a> Freeze for Context<'a>
impl<'a> RefUnwindSafe for Context<'a>
impl<'a> Send for Context<'a>
impl<'a> Sync for Context<'a>
impl<'a> Unpin for Context<'a>
impl<'a> UnsafeUnpin for Context<'a>
impl<'a> UnwindSafe for Context<'a>
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