#[non_exhaustive]pub struct ErrorReport {
pub kind: ErrorKind,
pub message: String,
pub status: i32,
pub partial: Option<Transcript>,
}Expand description
An owned, plain-data snapshot of a transcribe_cpp::Error: what crosses a
process or IPC boundary (e.g. a Tauri command’s error).
transcribe_cpp::Error itself serializes to exactly this shape under the
serde feature, and converts into it with From; deserialize into
ErrorReport on the receiving side (an Error cannot be rebuilt from it).
JSON looks like:
{ "kind": "aborted", "message": "operation aborted: ...", "status": 13, "partial": { "text": "..." } }partial is null unless the error carried a partial transcript. It is
always written (never skipped) so non-self-describing formats such as
postcard round-trip.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.kind: ErrorKindThe error category.
message: StringThe error’s Display text.
status: i32transcribe_cpp::Error::raw_status: the transcribe_status, or 0 for
Rust-side errors.
partial: Option<Transcript>transcribe_cpp::Error::partial, if any.
Implementations§
Source§impl ErrorReport
impl ErrorReport
Sourcepub fn new(kind: ErrorKind, message: impl Into<String>) -> ErrorReport
pub fn new(kind: ErrorKind, message: impl Into<String>) -> ErrorReport
A report of kind with message, no native status (0) and no partial
transcript: for errors raised outside the engine, such as a host
rejecting a request before it reaches a worker. Set
status and partial afterwards if
you have them.
use transcribe_cpp_types::{ErrorKind, ErrorReport};
let report = ErrorReport::new(ErrorKind::InputTooLong, "frame of 70000 samples exceeds 65536");
assert_eq!((report.status, report.partial), (0, None));Trait Implementations§
Source§impl Clone for ErrorReport
impl Clone for ErrorReport
Source§fn clone(&self) -> ErrorReport
fn clone(&self) -> ErrorReport
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ErrorReport
impl Debug for ErrorReport
Source§impl From<&Error> for ErrorReport
impl From<&Error> for ErrorReport
Source§impl From<Error> for ErrorReport
Moves the partial transcript out instead of cloning it.
impl From<Error> for ErrorReport
Moves the partial transcript out instead of cloning it.