Struct conjure_error::serializable_error::Builder
source · pub struct Builder { /* private fields */ }Expand description
A builder for the SerializableError type.
Implementations§
source§impl Builder
impl Builder
sourcepub fn error_code(&mut self, error_code: ErrorCode) -> &mut Self
pub fn error_code(&mut self, error_code: ErrorCode) -> &mut Self
The broad category of the error.
When transmitted over HTTP, this determines the response’s status code.
Required.
sourcepub fn error_name<T>(&mut self, error_name: T) -> &mut Self
pub fn error_name<T>(&mut self, error_name: T) -> &mut Self
The error’s name.
The name is made up of a namespace and more specific error name, separated by a :.
Required.
sourcepub fn error_instance_id(&mut self, error_instance_id: Uuid) -> &mut Self
pub fn error_instance_id(&mut self, error_instance_id: Uuid) -> &mut Self
A unique identifier for this error instance.
This can be used to correlate reporting about the error as it transfers between components of a distributed system.
Required.
sourcepub fn parameters<T>(&mut self, parameters: T) -> &mut Self
pub fn parameters<T>(&mut self, parameters: T) -> &mut Self
Parameters providing more information about the error.
sourcepub fn extend_parameters<T>(&mut self, parameters: T) -> &mut Self
pub fn extend_parameters<T>(&mut self, parameters: T) -> &mut Self
Parameters providing more information about the error.
sourcepub fn insert_parameters<K, V>(&mut self, key: K, value: V) -> &mut Self
pub fn insert_parameters<K, V>(&mut self, key: K, value: V) -> &mut Self
Parameters providing more information about the error.
sourcepub fn build(&self) -> SerializableError
pub fn build(&self) -> SerializableError
Trait Implementations§
source§impl From<SerializableError> for Builder
impl From<SerializableError> for Builder
source§fn from(_v: SerializableError) -> Builder
fn from(_v: SerializableError) -> Builder
Converts to this type from the input type.
Auto Trait Implementations§
impl RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl UnwindSafe for Builder
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