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.
Variants§
InvalidSender
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.
StateKeyPresent
Occurs when either the original event or the replacement event contains a state key.
State events are not allowed to be edited.
MismatchContentType
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
OriginalEventIsReplacement
Occurs when the original event is itself already a replacement (edit).
NotReplacement
Occurs when the replacement event is not a replacement for the original event.
MissingNewContent
Occurs when a required field is missing from either the original or the replacement event.
The event is considered malformed and cannot be validated.
InvalidJson(Error)
ReplacementNotEncrypted
Occurs when the original event is encrypted but the replacement event is not.
Trait Implementations§
Source§impl Debug for EditValidityError
impl Debug for EditValidityError
Source§impl Display for EditValidityError
impl Display for EditValidityError
Source§impl Error for EditValidityError
impl Error for EditValidityError
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
use the Display impl or to_string()