pub struct LnurlError {
pub reason: String,
pub status_code: StatusCode,
}Expand description
Error response for lnurl payment requests and callbacks.
Fields§
§reason: StringThe error message to be diplayed to the payer.
status_code: StatusCodeImplementations§
Source§impl LnurlError
impl LnurlError
Sourcepub fn bad_request(reason: impl Display) -> LnurlError
pub fn bad_request(reason: impl Display) -> LnurlError
Constructs a LnurlError with a StatusCode::BAD_REQUEST.
Sourcepub fn server_error() -> LnurlError
pub fn server_error() -> LnurlError
Constructs a LnurlError with a
StatusCode::INTERNAL_SERVER_ERROR.
NOTE: This is used as the default error code for all errors that occur
in the lnurl module in order to avoid leaking internal information
to external clients.
Trait Implementations§
Source§impl From<LnurlError> for LnurlErrorWire
impl From<LnurlError> for LnurlErrorWire
Source§fn from(e: LnurlError) -> LnurlErrorWire
fn from(e: LnurlError) -> LnurlErrorWire
Converts to this type from the input type.
Source§impl IntoResponse for LnurlError
Available on crate feature axum only.
impl IntoResponse for LnurlError
Available on crate feature
axum only.Source§fn into_response(self) -> Response<Body>
fn into_response(self) -> Response<Body>
Create a response.
Auto Trait Implementations§
impl Freeze for LnurlError
impl RefUnwindSafe for LnurlError
impl Send for LnurlError
impl Sync for LnurlError
impl Unpin for LnurlError
impl UnsafeUnpin for LnurlError
impl UnwindSafe for LnurlError
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