Struct Builder

Source
pub struct Builder<T>(/* private fields */);
Expand description

A builder for SerializableError

Implementations§

Source§

impl Builder<NameStage>

Source

pub fn name(self, name: impl Into<String>) -> Builder<ErrorInstanceIdStage>

Sets the name field.

Source§

impl Builder<ErrorInstanceIdStage>

Source

pub fn error_instance_id( self, error_instance_id: impl Into<String>, ) -> Builder<StatusCodeStage>

Sets the error_instance_id field.

Source§

impl Builder<StatusCodeStage>

Source

pub fn status_code(self, status_code: i32) -> Builder<Complete>

Sets the status_code field.

Source§

impl Builder<Complete>

Source

pub fn name(self, name: impl Into<String>) -> Self

Sets the name field.

Source

pub fn message(self, message: impl Into<Option<String>>) -> Self

Sets the message field.

Source

pub fn error_instance_id(self, error_instance_id: impl Into<String>) -> Self

Sets the error_instance_id field.

Source

pub fn status_code(self, status_code: i32) -> Self

Sets the status_code field.

Source

pub fn build(self) -> SerializableError

Consumes the builder, returning a SerializableError.

Trait Implementations§

Source§

impl Default for Builder<NameStage>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl From<SerializableError> for Builder<Complete>

Source§

fn from(v: SerializableError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<T> Freeze for Builder<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for Builder<T>
where T: RefUnwindSafe,

§

impl<T> Send for Builder<T>
where T: Send,

§

impl<T> Sync for Builder<T>
where T: Sync,

§

impl<T> Unpin for Builder<T>
where T: Unpin,

§

impl<T> UnwindSafe for Builder<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.