Struct zerror_core::ErrorCore
source · pub struct ErrorCore { /* private fields */ }Expand description
ErrorCore implements 100% of Z for easy error reporting. It’s intended that people will wrap and proxy ErrorCore and then implement a short summary on top that descends from an error enum.
Implementations§
source§impl ErrorCore
impl ErrorCore
sourcepub fn new(email: &str, short: &str, counter: &'static Counter) -> Self
pub fn new(email: &str, short: &str, counter: &'static Counter) -> Self
Create a new ErrorCore with the provided email and short summary. The provided counter will be clicked each time a new error is created, to give people insight into the error. It’s advisable to have a separate counter for different conditions.
Trait Implementations§
source§impl<'prototk> FieldPackHelper<'prototk, message<ErrorCore>> for ErrorCore
impl<'prototk> FieldPackHelper<'prototk, message<ErrorCore>> for ErrorCore
fn field_pack_sz(&self, tag: &Tag) -> usize
fn field_pack(&self, tag: &Tag, out: &mut [u8])
source§impl<'prototk> FieldUnpackHelper<'prototk, message<ErrorCore>> for ErrorCore
impl<'prototk> FieldUnpackHelper<'prototk, message<ErrorCore>> for ErrorCore
fn merge_field(&mut self, proto: message<ErrorCore>)
source§impl Packable for ErrorCore
impl Packable for ErrorCore
source§fn pack_sz(&self) -> usize
fn pack_sz(&self) -> usize
pack_sz returns the number of bytes required to serialize the Packable object.source§fn pack(&self, buf: &mut [u8])
fn pack(&self, buf: &mut [u8])
pack fills in the buffer out with the packed binary representation of the Packable
object. The implementor is responsible to ensure that out is exactly pack_sz() bytes
and implementations are encouraged to assert this. Read moresource§fn stream<W: Write>(&self, writer: &mut W) -> Result<usize, Error>
fn stream<W: Write>(&self, writer: &mut W) -> Result<usize, Error>
stream writes the object to the provided writer using the same representation that would
be used in a call to pack. The implementor is responsible for making sure that the
number of bytes written is exactly equal to the number of required bytes. Read moresource§impl<'prototk> Unpackable<'prototk> for ErrorCore
impl<'prototk> Unpackable<'prototk> for ErrorCore
source§impl Z for ErrorCore
impl Z for ErrorCore
impl<'prototk> Message<'prototk> for ErrorCore
Auto Trait Implementations§
impl RefUnwindSafe for ErrorCore
impl Send for ErrorCore
impl Sync for ErrorCore
impl Unpin for ErrorCore
impl UnwindSafe for ErrorCore
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