pub struct MatrixError {
pub status_code: Option<StatusCode>,
pub authenticate: Option<AuthenticateError>,
pub kind: ErrorKind,
pub body: ErrorBody,
}Expand description
A Matrix Error
Fields§
§status_code: Option<StatusCode>The http status code.
authenticate: Option<AuthenticateError>The WWW-Authenticate header error message.
kind: ErrorKind§body: ErrorBodyThe http response’s body.
Implementations§
Source§impl MatrixError
impl MatrixError
pub fn new(kind: ErrorKind, body: impl Into<ErrorBody>) -> Self
Sourcepub fn missing_token(body: impl Into<ErrorBody>) -> Self
pub fn missing_token(body: impl Into<ErrorBody>) -> Self
Create a new MatrixError.
Sourcepub fn unrecognized(body: impl Into<ErrorBody>) -> Self
pub fn unrecognized(body: impl Into<ErrorBody>) -> Self
Create a new MatrixError.
Create a new MatrixError.
Sourcepub fn user_deactivated(body: impl Into<ErrorBody>) -> Self
pub fn user_deactivated(body: impl Into<ErrorBody>) -> Self
Create a new MatrixError.
Sourcepub fn user_in_use(body: impl Into<ErrorBody>) -> Self
pub fn user_in_use(body: impl Into<ErrorBody>) -> Self
Create a new MatrixError.
Sourcepub fn invalid_username(body: impl Into<ErrorBody>) -> Self
pub fn invalid_username(body: impl Into<ErrorBody>) -> Self
Create a new MatrixError.
Sourcepub fn room_in_use(body: impl Into<ErrorBody>) -> Self
pub fn room_in_use(body: impl Into<ErrorBody>) -> Self
Create a new MatrixError.
Sourcepub fn invalid_room_state(body: impl Into<ErrorBody>) -> Self
pub fn invalid_room_state(body: impl Into<ErrorBody>) -> Self
Create a new MatrixError.
Sourcepub fn threepid_in_use(body: impl Into<ErrorBody>) -> Self
pub fn threepid_in_use(body: impl Into<ErrorBody>) -> Self
Create a new MatrixError.
Sourcepub fn threepid_not_found(body: impl Into<ErrorBody>) -> Self
pub fn threepid_not_found(body: impl Into<ErrorBody>) -> Self
Create a new MatrixError.
Sourcepub fn threepid_auth_failed(body: impl Into<ErrorBody>) -> Self
pub fn threepid_auth_failed(body: impl Into<ErrorBody>) -> Self
Create a new MatrixError.
Sourcepub fn threepid_denied(body: impl Into<ErrorBody>) -> Self
pub fn threepid_denied(body: impl Into<ErrorBody>) -> Self
Create a new MatrixError.
Sourcepub fn server_not_trusted(body: impl Into<ErrorBody>) -> Self
pub fn server_not_trusted(body: impl Into<ErrorBody>) -> Self
Create a new MatrixError.
Sourcepub fn unsupported_room_version(body: impl Into<ErrorBody>) -> Self
pub fn unsupported_room_version(body: impl Into<ErrorBody>) -> Self
Create a new MatrixError.
Sourcepub fn guest_access_forbidden(body: impl Into<ErrorBody>) -> Self
pub fn guest_access_forbidden(body: impl Into<ErrorBody>) -> Self
Create a new MatrixError.
Sourcepub fn captcha_needed(body: impl Into<ErrorBody>) -> Self
pub fn captcha_needed(body: impl Into<ErrorBody>) -> Self
Create a new MatrixError.
Sourcepub fn captcha_invalid(body: impl Into<ErrorBody>) -> Self
pub fn captcha_invalid(body: impl Into<ErrorBody>) -> Self
Create a new MatrixError.
Sourcepub fn missing_param(body: impl Into<ErrorBody>) -> Self
pub fn missing_param(body: impl Into<ErrorBody>) -> Self
Create a new MatrixError.
Sourcepub fn invalid_param(body: impl Into<ErrorBody>) -> Self
pub fn invalid_param(body: impl Into<ErrorBody>) -> Self
Create a new MatrixError.
Sourcepub fn cannot_leave_server_notice_room(body: impl Into<ErrorBody>) -> Self
pub fn cannot_leave_server_notice_room(body: impl Into<ErrorBody>) -> Self
Create a new MatrixError.
Sourcepub fn weak_password(body: impl Into<ErrorBody>) -> Self
pub fn weak_password(body: impl Into<ErrorBody>) -> Self
Create a new MatrixError.
Create a new MatrixError.
Sourcepub fn unable_to_grant_join(body: impl Into<ErrorBody>) -> Self
pub fn unable_to_grant_join(body: impl Into<ErrorBody>) -> Self
Create a new MatrixError.
Sourcepub fn duplicate_annotation(body: impl Into<ErrorBody>) -> Self
pub fn duplicate_annotation(body: impl Into<ErrorBody>) -> Self
Create a new MatrixError.
Sourcepub fn not_yet_uploaded(body: impl Into<ErrorBody>) -> Self
pub fn not_yet_uploaded(body: impl Into<ErrorBody>) -> Self
Create a new MatrixError.
Sourcepub fn cannot_overwrite_media(body: impl Into<ErrorBody>) -> Self
pub fn cannot_overwrite_media(body: impl Into<ErrorBody>) -> Self
Create a new MatrixError.
Sourcepub fn unknown_pos(body: impl Into<ErrorBody>) -> Self
pub fn unknown_pos(body: impl Into<ErrorBody>) -> Self
Create a new MatrixError.
Sourcepub fn url_not_set(body: impl Into<ErrorBody>) -> Self
pub fn url_not_set(body: impl Into<ErrorBody>) -> Self
Create a new MatrixError.
Sourcepub fn bad_status(body: impl Into<ErrorBody>) -> Self
pub fn bad_status(body: impl Into<ErrorBody>) -> Self
Create a new MatrixError.
Sourcepub fn connection_failed(body: impl Into<ErrorBody>) -> Self
pub fn connection_failed(body: impl Into<ErrorBody>) -> Self
Create a new MatrixError.
Sourcepub fn connection_timeout(body: impl Into<ErrorBody>) -> Self
pub fn connection_timeout(body: impl Into<ErrorBody>) -> Self
Create a new MatrixError.
pub fn unknown_token(soft_logout: bool, body: impl Into<ErrorBody>) -> Self
pub fn limit_exceeded( retry_after_ms: Option<Duration>, body: impl Into<ErrorBody>, ) -> Self
pub fn incompatible_room_version( room_version: RoomVersionId, body: impl Into<ErrorBody>, ) -> Self
pub fn resource_limit_exceeded( admin_contact: String, body: impl Into<ErrorBody>, ) -> Self
pub fn wrong_room_keys_version( current_version: Option<String>, body: impl Into<ErrorBody>, ) -> Self
pub fn is_not_found(&self) -> bool
Trait Implementations§
Source§impl Clone for MatrixError
impl Clone for MatrixError
Source§fn clone(&self) -> MatrixError
fn clone(&self) -> MatrixError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MatrixError
impl Debug for MatrixError
Source§impl Display for MatrixError
impl Display for MatrixError
Source§impl Error for MatrixError
impl Error for MatrixError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl Scribe for MatrixError
impl Scribe for MatrixError
Auto Trait Implementations§
impl Freeze for MatrixError
impl RefUnwindSafe for MatrixError
impl Send for MatrixError
impl Sync for MatrixError
impl Unpin for MatrixError
impl UnwindSafe for MatrixError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
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>
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>
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 moreSource§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
self to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
&self to an expression for Diesel’s query builder. Read moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read moreSource§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Source§impl<P> Writer for P
impl<P> Writer for P
Source§fn write<'life0, 'life1, 'life2, 'async_trait>(
self,
_req: &'life0 mut Request,
_depot: &'life1 mut Depot,
res: &'life2 mut Response,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
P: 'async_trait,
fn write<'life0, 'life1, 'life2, 'async_trait>(
self,
_req: &'life0 mut Request,
_depot: &'life1 mut Depot,
res: &'life2 mut Response,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
P: 'async_trait,
Response.