Enum EditValidityError
Source pub enum EditValidityError {
InvalidSender,
StateKeyPresent,
MismatchContentType {
content_type: String,
replacement_type: String,
},
OriginalEventIsReplacement,
NotReplacement,
MissingNewContent,
InvalidJson(Error),
ReplacementNotEncrypted,
}
Expand description
Represents all possible validation errors that can occur when processing
an event edit.
These errors ensure that a replacement event complies with the rules
required to safely and correctly modify an existing event.
Occurs when the sender of the replacement event does not match
the sender of the original event.
Only the original sender is allowed to edit their own event.
Occurs when either the original event or the replacement event contains
a state key.
State events are not allowed to be edited.
Occurs when the content type of the original event differs from
that of the replacement event.
Edits must not change the event’s content type, as this would
introduce semantic inconsistencies.
Fields
The content type of the original event.
The content type of the replacement event.
Occurs when the original event is itself already a replacement (edit).
Occurs when the replacement event is not a replacement for the original
event.
Occurs when a required field is missing from either the original
or the replacement event.
The event is considered malformed and cannot be validated.
Occurs when the original event is encrypted but the replacement
event is not.
Formats the value using the given formatter.
Read more
Formats the value using the given formatter.
Read more
Returns the lower-level source of this error, if any.
Read more
👎Deprecated since 1.42.0: use the Display impl or to_string()
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports.
Read more
Converts to this type from the input type.
Immutably borrows from an owned value.
Read more
Mutably borrows from an owned value.
Read more
Applies the [
Compat] adapter by value.
Read more
Applies the [
Compat] adapter by shared reference.
Read more
Applies the [
Compat] adapter by mutable reference.
Read more
The DropFlavor that
wraps
T into
Self
Returns the argument unchanged.
Create a new handle for an Arc value
Read more
Consume a handle, getting back the initial
Arc<> Read more
Get a clone of the
Arc<> using a “borrowed” handle.
Read more
A constant of the type witness
Proof that Self is the same type as Self::Type,
provides methods for casting between Self and Self::Type.
The same type as Self,
used to emulate type equality bounds (T == U)
with associated type equality constraints
(T: Identity<Type = U>).
Instruments this type with the provided [
Span], returning an
Instrumented wrapper.
Read more
Calls U::from(self).
That is, this conversion is whatever the implementation of
From<T> for U chooses to do.
Converts the given value to a
String.
Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.