Skip to main content

TextEditError

Enum TextEditError 

Source
#[non_exhaustive]
pub enum TextEditError {
Show 15 variants StaleMatch { match_id: MatchId, reason: StaleReason, }, InvalidMatchId { reason: String, }, InvalidQuery { reason: String, }, OverlappingEdits { a: MatchId, b: MatchId, }, DuplicateStage { match_id: MatchId, }, UnsupportedContainer { match_id: MatchId, kind: UnsupportedContainer, }, UnsupportedStyleSpan { match_id: MatchId, detail: String, }, EncodingFailed { match_id: Option<MatchId>, font: String, detail: String, }, FontFallbackDenied { match_id: Option<MatchId>, font: String, detail: String, }, TaggedTextConflict { match_id: MatchId, visual_text: String, actual_text: String, }, SignedDocumentRejected { signatures: Vec<SignatureSummary>, }, PermissionsDenied, UnsupportedFitPolicy { policy: FitPolicy, }, Document(ManipError), Internal { detail: String, },
}
Expand description

Typed errors of the text-edit engine.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

StaleMatch

The locator does not resolve against the current document revision.

Fields

§match_id: MatchId

The stale locator.

§reason: StaleReason

Why it is stale.

§

InvalidMatchId

The token could not be decoded or failed strict validation.

Fields

§reason: String

Decoder diagnostics.

§

InvalidQuery

The query is malformed (e.g. empty needle).

Fields

§reason: String

What was wrong.

§

OverlappingEdits

Two staged edits overlap in the same container.

Fields

§a: MatchId

First edit.

§b: MatchId

Second edit.

§

DuplicateStage

The same match was staged twice.

Fields

§match_id: MatchId

The duplicated locator.

§

UnsupportedContainer

The match lives in a container the engine cannot edit yet.

Fields

§match_id: MatchId

The match.

§kind: UnsupportedContainer

Container kind.

§

UnsupportedStyleSpan

The match spans text with differing font/size/style.

Fields

§match_id: MatchId

The match.

§detail: String

Which styles differ.

§

EncodingFailed

Replacement (or retained) text could not be encoded.

Fields

§match_id: Option<MatchId>

The edit, when attributable.

§font: String

Font that could not encode the text.

§detail: String

Encoder diagnostics.

§

FontFallbackDenied

The original font cannot encode the replacement and the policy is FontFallback::Deny.

Fields

§match_id: Option<MatchId>

The edit, when attributable.

§font: String

The original font.

§detail: String

Why the original font failed.

§

TaggedTextConflict

The match is covered by /ActualText (design §7).

Fields

§match_id: MatchId

The match.

§visual_text: String

Decoded glyph text.

§actual_text: String

The enclosing /ActualText value.

§

SignedDocumentRejected

The document carries digital signatures and the policy is SignaturePolicy::RejectSignedDocuments.

Fields

§signatures: Vec<SignatureSummary>

The signatures found.

§

PermissionsDenied

Document permissions forbid content modification.

§

UnsupportedFitPolicy

The requested fit policy is not implemented in this phase.

Fields

§policy: FitPolicy

The requested policy.

§

Document(ManipError)

Underlying document error.

§

Internal

Invariant violation — please report.

Fields

§detail: String

Diagnostics.

Trait Implementations§

Source§

impl Debug for TextEditError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for TextEditError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for TextEditError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<ManipError> for TextEditError

Source§

fn from(source: ManipError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<U, T> ToOwnedObj<U> for T
where U: FromObjRef<T>,

Source§

fn to_owned_obj(&self, data: FontData<'_>) -> U

Convert this type into T, using the provided data to resolve any offsets.
Source§

impl<U, T> ToOwnedTable<U> for T
where U: FromTableRef<T>,

Source§

fn to_owned_table(&self) -> U

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.