Skip to main content

OpsCode

Enum OpsCode 

Source
#[non_exhaustive]
pub enum OpsCode {
Show 91 variants InvalidInput, UpstreamUnmapped, InternalInvariant, JsonParseFailed, JsonSerializeFailed, UnknownSchemaType, PresetNotFound, InputTooLarge, AssetPlanMismatch, AssetIdentityConflict, DecodeFailed, EncodeFailed, EncodeSemanticLoss, ValidationFailed, MdDecodeFailed, StyleStoreFailed, NoFonts, StyleRebindFailed, AnalysisFailed, GridAddrInvalid, GridAddrProjectionFailed, EmptyFieldValue, FieldNotFound, FieldNameAmbiguous, FieldNotFillable, FillFailed, NoValues, SectionOutOfRange, SectionIndexMismatch, PatchFailed, SectionWorkflowFailed, ReadTargetRequired, ReadParasInvalid, ReadParasWithoutSection, ReadSectionOutOfRange, ReadParaRangeInvalid, ReadTableOutOfRange, ReadFieldNotFound, TableNotFound, TableGridInvalid, TableGridUnaddressable, CellNotFound, CellLabelAmbiguous, CellHasNonTextContent, CellTargetDuplicate, CellTargetConflict, InputNotRoundtripSafe, InputEntriesNotCarried, SetCellCodecFailed, SetCellFailed, InvalidSetCellArgs, InvalidSetCellMap, StampFailed, StampCodecFailed, StampManifestInvariant, StampSourceHashMismatch, StampDeltaMismatch, StampCellNotAnchor, StampCellNotEmpty, StampLabelDrift, StampCellNotCandidate, StampCellTargetDuplicate, StampNameEmpty, StampHintBlank, StampNameDuplicate, StampNameCollision, StampCandidateUncovered, StampSpecStale, StampMarkerMismatch, StampSpecDuplicate, InvalidStampMap, MissingSourceSha256, StructuralEditFailed, StructuralCodec, ParagraphOutOfRange, DuplicateTarget, ReferenceStranded, HardBreakLoss, EmptySection, SectionPropertiesParagraph, SpanCountMismatch, SelfVerifyFailed, MultiParagraphText, InsertBeforeSectionProperties, DeleteNoTarget, InsertTextRequired, Hwp5DecodeFailed, Hwp5ConvertFailed, UnrecognizedFormat, PdfRenderFailed, InvalidDiscovery,
}
Expand description

Stable, machine-readable code for an operation failure class.

The string form (OpsCode::as_str) is the public contract that CLI JSON errors, MCP tool errors and Python HwpForgeError.code expose. Variants are additive; the enum is #[non_exhaustive], so match on it with a wildcard arm outside this crate.

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.
§

InvalidInput

Arguments were syntactically valid but semantically unusable (mutually exclusive targets, empty lists, …).

§

UpstreamUnmapped

An upstream error variant that this table has no mapping for yet; the message keeps the original type name.

§

InternalInvariant

A library invariant was violated — a bug, not a user error.

§

JsonParseFailed

JSON input could not be parsed.

§

JsonSerializeFailed

A result could not be serialised to JSON.

§

UnknownSchemaType

Requested JSON schema kind does not exist.

§

PresetNotFound

Named style preset does not exist.

§

InputTooLarge

Input exceeds the accepted size limit.

§

AssetPlanMismatch

Provisioned assets do not line up with the document’s asset plan (missing, extra, duplicate or reordered occurrence).

§

AssetIdentityConflict

Two provisioned assets claim the same identity with different bytes.

§

DecodeFailed

HWPX package or XML could not be decoded.

§

EncodeFailed

HWPX (or Markdown) output could not be encoded.

§

EncodeSemanticLoss

A regenerating edit refused to emit bytes because encoding reported semantic-loss warnings (fail-closed).

§

ValidationFailed

Core document validation failed.

§

MdDecodeFailed

Markdown input could not be decoded.

§

StyleStoreFailed

Style store could not be built from the preset.

§

NoFonts

The document has no fonts, so a restyle has nothing to rebind.

§

StyleRebindFailed

Style references could not be rebound to the preset.

§

AnalysisFailed

Document analysis (inspect) failed.

§

GridAddrInvalid

A table cell grid address is invalid.

§

GridAddrProjectionFailed

A table grid could not be projected for addressing.

§

EmptyFieldValue

A field value was empty (clearing a field is unsupported).

§

FieldNotFound

Named field does not exist in the document.

§

FieldNameAmbiguous

Several fields share the requested name.

§

FieldNotFillable

The field exists but is not a fillable click-here field.

§

FillFailed

Fill workflow failed for another reason.

§

NoValues

No field values were supplied.

§

SectionOutOfRange

Requested section index is outside the document.

§

SectionIndexMismatch

Section index in the payload does not match the requested one.

§

PatchFailed

Preserving patch could not be applied.

§

SectionWorkflowFailed

Section export/patch workflow failed for another reason.

§

ReadTargetRequired

read needs exactly one target (section, paragraphs, table or field).

§

ReadParasInvalid

Paragraph range expression could not be parsed.

§

ReadParasWithoutSection

Paragraph range given without a section.

§

ReadSectionOutOfRange

read section index is outside the document.

§

ReadParaRangeInvalid

read paragraph range is outside the section.

§

ReadTableOutOfRange

read table ordinal is outside the document.

§

ReadFieldNotFound

read field name does not exist.

§

TableNotFound

Table ordinal does not exist.

§

TableGridInvalid

Table grid is malformed.

§

TableGridUnaddressable

Table grid cannot be addressed by label.

§

CellNotFound

Addressed cell does not exist.

§

CellLabelAmbiguous

Cell label matches more than one cell.

§

CellHasNonTextContent

Target cell contains non-text content that an edit would destroy.

§

CellTargetDuplicate

The same cell was targeted twice.

§

CellTargetConflict

Two cell specs resolve to conflicting targets.

§

InputNotRoundtripSafe

Input document is not round-trip safe, so a regenerating edit was refused.

§

InputEntriesNotCarried

ZIP entries of the input would be lost by re-encoding, so the edit was refused.

§

SetCellCodecFailed

Cell edit failed inside the codec.

§

SetCellFailed

Cell edit failed for another reason.

§

InvalidSetCellArgs

Cell edit arguments are inconsistent (single target and spec list mixed, …).

§

InvalidSetCellMap

Cell edit spec list is malformed.

§

StampFailed

Stamping failed for another reason.

§

StampCodecFailed

Stamping failed inside the codec.

§

StampManifestInvariant

Stamp manifest violated an invariant.

§

StampSourceHashMismatch

Stamp request was made for a different source document (hash mismatch).

§

StampDeltaMismatch

Stamp output failed self-verification.

§

StampCellNotAnchor

Cell stamp target is not the anchor of its merged region.

§

StampCellNotEmpty

Cell stamp target is not an empty cell.

§

StampLabelDrift

Cell label drifted since the plan was made.

§

StampCellNotCandidate

Cell stamp target is not a plan candidate.

§

StampCellTargetDuplicate

The same cell was stamped twice.

§

StampNameEmpty

Stamp field name is empty.

§

StampHintBlank

Cell stamp hint is blank.

§

StampNameDuplicate

Stamp field name is used twice in the request.

§

StampNameCollision

Stamp field name collides with an existing field.

§

StampCandidateUncovered

A plan candidate was neither named nor ignored.

§

StampSpecStale

Stamp spec no longer matches the document.

§

StampMarkerMismatch

Stamp marker text differs from the plan.

§

StampSpecDuplicate

The same span was specified twice.

§

InvalidStampMap

Stamp request payload is malformed.

§

MissingSourceSha256

A v2 stamp request lacks source_sha256.

§

StructuralEditFailed

Structural edit failed for another reason.

§

StructuralCodec

Structural edit failed inside the codec.

§

ParagraphOutOfRange

Paragraph index is outside the section.

§

DuplicateTarget

The same paragraph was targeted twice.

§

ReferenceStranded

Deleting would strand a reference (note, bookmark, …).

§

HardBreakLoss

Edit would lose a hard break.

§

EmptySection

Edit would leave a section empty.

§

SectionPropertiesParagraph

The section-properties paragraph cannot be edited.

§

SpanCountMismatch

Span count changed unexpectedly.

§

SelfVerifyFailed

Structural edit output failed self-verification.

§

MultiParagraphText

Inserted text spans several paragraphs where one is required.

§

InsertBeforeSectionProperties

Insertion before the section-properties paragraph is not allowed.

§

DeleteNoTarget

delete_para was given no target.

§

InsertTextRequired

insert_para was given no text.

§

Hwp5DecodeFailed

HWP5 input could not be decoded.

§

Hwp5ConvertFailed

HWP5 → HWPX conversion failed.

§

UnrecognizedFormat

Input bytes are neither HWP5 nor HWPX.

§

PdfRenderFailed

PDF rendering failed (the renderer’s own code is carried as the cause).

§

InvalidDiscovery

Font discovery mode is not one of the accepted values.

Implementations§

Source§

impl OpsCode

Source

pub const ALL: &'static [OpsCode]

Every code, in declaration order (for inventories and snapshots).

Source

pub const fn as_str(self) -> &'static str

The stable wire string, e.g. "DECODE_FAILED".

Source

pub fn lookup(wire: &str) -> Option<OpsCode>

Looks a wire string up (exact match only).

Trait Implementations§

Source§

impl Clone for OpsCode

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for OpsCode

Source§

impl Debug for OpsCode

Source§

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

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

impl<'de> Deserialize<'de> for OpsCode

Source§

fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for OpsCode

Source§

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

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

impl Eq for OpsCode

Source§

impl FromStr for OpsCode

Source§

type Err = UnknownOpsCode

The associated error which can be returned from parsing.
Source§

fn from_str(wire: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
Source§

impl Hash for OpsCode

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for OpsCode

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for OpsCode

Source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for OpsCode

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.