pub struct ErrorContextBuilder { /* private fields */ }Expand description
A builder that constructs an ErrorContext with a fluent API.
§Examples
use oximedia_core::error_context::ErrorContextBuilder;
let ctx = ErrorContextBuilder::new("codec", "decode_frame")
.message("bitstream error")
.field("pts", "12345")
.build();
assert_eq!(ctx.component(), "codec");
assert_eq!(ctx.field("pts"), Some("12345"));Implementations§
Source§impl ErrorContextBuilder
impl ErrorContextBuilder
Sourcepub fn new(component: &str, operation: &str) -> Self
pub fn new(component: &str, operation: &str) -> Self
Starts a new builder with the given component and operation.
Sourcepub fn build(self) -> ErrorContext
pub fn build(self) -> ErrorContext
Consumes the builder and returns the constructed ErrorContext.
Trait Implementations§
Source§impl Debug for ErrorContextBuilder
impl Debug for ErrorContextBuilder
Source§impl Default for ErrorContextBuilder
impl Default for ErrorContextBuilder
Source§fn default() -> ErrorContextBuilder
fn default() -> ErrorContextBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ErrorContextBuilder
impl RefUnwindSafe for ErrorContextBuilder
impl Send for ErrorContextBuilder
impl Sync for ErrorContextBuilder
impl Unpin for ErrorContextBuilder
impl UnsafeUnpin for ErrorContextBuilder
impl UnwindSafe for ErrorContextBuilder
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