pub enum AppMessage {
Show 16 variants
Unauthorized,
Forbidden,
InternalServerError,
ErrorMessage(String, StatusCode),
MissingEnvironmentVariable(String, VarError),
InternalServerErrorMessage(&'static str),
Redirect(&'static str),
SuccessMessage(&'static str),
SuccessMessageString(String),
WarningMessage(&'static str),
WarningMessageString(String),
UnAuthorizedMessage(&'static str),
UnAuthorizedMessageString(String),
ForbiddenMessage(&'static str),
ForbiddenMessageString(String),
EntityNotFound(String),
}
Variants§
Forbidden
InternalServerError
ErrorMessage(String, StatusCode)
MissingEnvironmentVariable(String, VarError)
InternalServerErrorMessage(&'static str)
Redirect(&'static str)
SuccessMessage(&'static str)
SuccessMessageString(String)
WarningMessage(&'static str)
WarningMessageString(String)
UnAuthorizedMessage(&'static str)
UnAuthorizedMessageString(String)
ForbiddenMessage(&'static str)
ForbiddenMessageString(String)
EntityNotFound(String)
Implementations§
Source§impl AppMessage
impl AppMessage
Sourcepub fn status_code(&self) -> StatusCode
pub fn status_code(&self) -> StatusCode
Get the status code
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Check if the message is a success
Sourcepub fn into_anyhow(self) -> Error
pub fn into_anyhow(self) -> Error
Convert to anyhow::Error
Sourcepub fn into_result<T>(self) -> AppResult<T>
pub fn into_result<T>(self) -> AppResult<T>
Convert to AppResult
Trait Implementations§
Source§impl Clone for AppMessage
impl Clone for AppMessage
Source§fn clone(&self) -> AppMessage
fn clone(&self) -> AppMessage
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for AppMessage
impl Debug for AppMessage
Source§impl Display for AppMessage
impl Display for AppMessage
Source§impl Error for AppMessage
impl Error for AppMessage
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for AppMessage
impl RefUnwindSafe for AppMessage
impl Send for AppMessage
impl Sync for AppMessage
impl Unpin for AppMessage
impl UnwindSafe for AppMessage
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