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
Auto Trait Implementations§
impl Freeze for EditValidityError
impl !RefUnwindSafe for EditValidityError
impl Send for EditValidityError
impl Sync for EditValidityError
impl Unpin for EditValidityError
impl UnsafeUnpin for EditValidityError
impl !UnwindSafe for EditValidityError
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
§impl<T> CompatExt for T
impl<T> CompatExt for T
Source§impl<T> DropFlavorWrapper<T> for T
impl<T> DropFlavorWrapper<T> for T
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Arc<> Read more