Enum EditValidityError
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§
§impl Debug for EditValidityError
impl Debug for EditValidityError
§impl Display for EditValidityError
impl Display for EditValidityError
§impl Error for EditValidityError
impl Error for EditValidityError
§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
§impl From<Error> for EditValidityError
impl From<Error> for EditValidityError
§fn from(source: Error) -> EditValidityError
fn from(source: Error) -> EditValidityError
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
Source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 more