pub enum PdfEditError {
}Expand description
Stable, typed rejection reasons for PDF-editor commands. Crosses Tauri IPC as a JSON tag +
message; thiserror::Error gives each variant the exact user-facing string from §11. Kept
verbatim against the contract — do not add fields or reorder variants without updating §11
first, since every lane (B1 inspection, B2 fonts, C1 composition, C2 save) matches on these by
name.
Serialize is hand-written, not derived: this codebase’s existing typed-error convention
(the host error type in error.rs) wraps every variant in a { code, message } envelope via
#[serde(tag = "code", content = "message", rename_all = "snake_case")]. That attribute only
populates content for variants that carry data; every PdfEditError variant is a bare unit
variant (the message comes from thiserror’s Display, not a field), so the derive would
serialize as a bare string tag with no message key. pdfEditModel.ts (A2) already models the
frontend side as { code: PdfEditErrorCode, message: string } matching the host error type’s
envelope — this manual impl produces exactly that shape so the two sides agree without D2
needing to reconcile a mismatch later.
Variants§
StaleSource
SourceDigestMismatch
NoUniqueMatch
UnsupportedTransform
UnsupportedEncoding
MissingGlyph
MissingGlyphs(Vec<char>)
A replacement needs characters the island’s own (subset) font cannot encode. Distinct from
PdfEditError::UnsupportedEncoding (“this font can never be re-encoded”): the island is
editable, this particular text is not. Wire code is missing_glyph, the same as
PdfEditError::MissingGlyph; the message names the characters.
FontEmbeddingDenied
TextOverflow
MalformedContent
EncryptedDocument
AnnotationSerializationFailed
VerificationFailed
WriteConflict
Implementations§
Source§impl PdfEditError
impl PdfEditError
Sourcepub fn missing_chars(&self) -> Option<&[char]>
pub fn missing_chars(&self) -> Option<&[char]>
The characters a PdfEditError::MissingGlyphs refusal names, in first-appearance order.
Trait Implementations§
Source§impl Debug for PdfEditError
impl Debug for PdfEditError
Source§impl Display for PdfEditError
impl Display for PdfEditError
Source§impl Error for PdfEditError
impl Error for PdfEditError
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
use the Display impl or to_string()
Source§impl From<PdfEditError> for CommitError
impl From<PdfEditError> for CommitError
Source§fn from(source: PdfEditError) -> Self
fn from(source: PdfEditError) -> Self
Auto Trait Implementations§
impl Freeze for PdfEditError
impl RefUnwindSafe for PdfEditError
impl Send for PdfEditError
impl Sync for PdfEditError
impl Unpin for PdfEditError
impl UnsafeUnpin for PdfEditError
impl UnwindSafe for PdfEditError
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> 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> Pointable for T
impl<T> Pointable for T
Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T, using the provided data to resolve any offsets.