Skip to main content

Report

Struct Report 

Source
pub struct Report { /* private fields */ }
Expand description

A TSDuck report owner.

Report is !Send + !Sync. Native objects borrowing a report retain an Rc<Report> and release their native owner before releasing that Rc.

Implementations§

Source§

impl Report

Source

pub fn null() -> Result<Rc<Self>>

Returns TSDuck’s process-wide null report.

Source

pub fn stderr() -> Result<Rc<Self>>

Returns TSDuck’s process-wide standard-error report.

Source

pub fn asynchronous(config: AsyncReportConfig) -> Result<Rc<Self>>

Creates an owned asynchronous report.

Source

pub fn asynchronous_with_forwarder( config: AsyncReportConfig, forwarder: ReportForwarder, ) -> Result<Rc<Self>>

Creates an asynchronous report that forwards native diagnostics.

The callback receives an owned, decoded view only for the duration of its invocation. It may run on a TSDuck worker or producer thread and must not block. timed_log is rejected because TSDuck’s callback-report ABI does not expose that option.

TSDuck’s callback-report ABI has no per-report userdata. Multiple forwarding reports can run only when they clone this same forwarder; a different destination is rejected until every active report using the current one is terminated or dropped. Each report retains its forwarding state until native asynchronous shutdown has completed.

§Errors

Returns an error when timed_log is enabled, a different forwarding destination is active, or TSDuck cannot construct the native report.

Source

pub fn set_max_severity(&mut self, severity: Severity) -> Result<()>

Changes this report’s maximum severity.

Source

pub fn log(&self, severity: Severity, message: &str) -> Result<()>

Writes one message to this report.

Source

pub fn terminate(&mut self) -> Result<()>

Flushes and terminates an asynchronous report.

This waits for queued forwarding callbacks to finish. Calling it more than once is a no-op; static reports cannot be terminated.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Report

§

impl !Send for Report

§

impl !Sync for Report

§

impl !UnwindSafe for Report

§

impl Freeze for Report

§

impl Unpin for Report

§

impl UnsafeUnpin for Report

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