#[repr(C)]pub struct PluginError {
pub code: PluginErrorCode,
pub message: OwnedBytes,
}Expand description
Generic plug-in error returned across the boundary.
message is owned by the producer; the consumer drops it via its
OwnedBytes drop_fn once it has been logged or wrapped.
Fields§
§code: PluginErrorCode§message: OwnedBytesImplementations§
Source§impl PluginError
impl PluginError
Sourcepub fn generic(message: impl AsRef<str>) -> Self
pub fn generic(message: impl AsRef<str>) -> Self
Constructs an error with a Generic code and a message string.
Sourcepub fn new(code: PluginErrorCode, message: impl AsRef<str>) -> Self
pub fn new(code: PluginErrorCode, message: impl AsRef<str>) -> Self
Constructs an error with the given code and message string.
Sourcepub fn panic(message: impl AsRef<str>) -> Self
pub fn panic(message: impl AsRef<str>) -> Self
Constructs a panic error with the given message.
Sourcepub fn message_string(&self) -> String
pub fn message_string(&self) -> String
Returns the message as a String (lossy if non-UTF8).
Trait Implementations§
Auto Trait Implementations§
impl !Sync for PluginError
impl Freeze for PluginError
impl RefUnwindSafe for PluginError
impl Send for PluginError
impl Unpin for PluginError
impl UnsafeUnpin for PluginError
impl UnwindSafe for PluginError
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