pub struct Refusal { /* private fields */ }Expand description
Why an action declined to run, in the user’s words, and, where a caller acts on the reason rather than reads it, a stable code naming it.
Implementations§
Source§impl Refusal
impl Refusal
pub fn new(reason: impl Into<String>) -> Self
Sourcepub fn coded(code: impl Into<String>, reason: impl Into<String>) -> Self
pub fn coded(code: impl Into<String>, reason: impl Into<String>) -> Self
A refusal a caller tells apart by code (a thing the action would add
is there already, say), with reason in words beside it for whoever
reads.
Sourcepub fn into_reason(self) -> String
pub fn into_reason(self) -> String
Why, in the user’s words, owned.
Trait Implementations§
impl Eq for Refusal
Source§impl From<ActionError> for Refusal
An action’s refusal as a verb’s, for a reader above the action that hands
it on: one a caller decides on keeps its code.
impl From<ActionError> for Refusal
An action’s refusal as a verb’s, for a reader above the action that hands it on: one a caller decides on keeps its code.
Source§fn from(error: ActionError) -> Self
fn from(error: ActionError) -> Self
Converts to this type from the input type.
Source§impl From<Refusal> for ActionError
A verb’s refusal as the action’s: one a caller decides on keeps its code.
impl From<Refusal> for ActionError
A verb’s refusal as the action’s: one a caller decides on keeps its code.
impl StructuralPartialEq for Refusal
Auto Trait Implementations§
impl Forget for Refusal
impl Freeze for Refusal
impl Move for Refusal
impl RefUnwindSafe for Refusal
impl Send for Refusal
impl Sync for Refusal
impl Unpin for Refusal
impl UnsafeUnpin for Refusal
impl UnwindSafe for Refusal
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more