Skip to main content

SchemaLoadError

Enum SchemaLoadError 

Source
pub enum SchemaLoadError {
Show 31 variants Io { path: PathBuf, source: Error, }, ParseManifest { path: PathBuf, source: Error, }, ParseType { path: PathBuf, source: Error, }, InvalidVersion { value: String, }, InvalidName { value: String, reason: &'static str, }, TypeFileMismatch { declared: Vec<String>, found: Vec<String>, }, TypeNameMismatch { file: String, declared: String, }, PropagatingRelationshipsRenamed { type_name: String, }, ExamplesRetired { type_name: String, }, OptionalRetired { type_name: String, field: String, }, InvalidDueAxis { type_name: String, offender: String, reason: String, }, MissingDefaultWeight, DuplicateRelationship { name: String, }, UndeclaredRelationship { type_name: String, field: &'static str, relationship: String, available: Vec<String>, }, CatchAllViolation { type_name: String, count: usize, }, UnknownFieldReference { type_name: String, field: &'static str, reference: String, }, InvalidConstraint { type_name: String, kind: &'static str, offender: String, reason: String, }, InvalidSectionFormat { type_name: String, section: String, problems: Vec<String>, }, DefaultValueNotInEnum { type_name: String, field: String, default: String, allowed: Vec<String>, }, RedeclaredBaseField { type_name: String, field: String, }, UndeclaredRelationshipType { relationship: String, field: &'static str, reference: String, declared: Vec<String>, }, ReservedSchemaKey { type_name: String, kind: &'static str, offending_key: String, reserved_keys: Vec<String>, }, InvalidCrossMemToSchema { value: String, reason: String, }, DuplicateCrossMemToSchema { to_schema: String, }, SealedPackageMissingManifest, CrossMemWildcardWithoutAliasTarget, CrossMemWildcardNonAliasRelType { rel_type: String, alias_target: String, }, UndeclaredCrossMemSourceType { to_schema: String, relationship: String, reference: String, declared: Vec<String>, }, AliasTargetRelTypeNotDeclared { schema: String, target: String, declared: Vec<String>, }, SectionHeadingMismatch { violations: Vec<HeadingKeyViolation>, }, Multiple { errors: Vec<SchemaLoadError>, },
}

Variants§

§

Io

Fields

§path: PathBuf
§source: Error
§

ParseManifest

Fields

§path: PathBuf
§source: Error
§

ParseType

Fields

§path: PathBuf
§source: Error
§

InvalidVersion

Fields

§value: String
§

InvalidName

Fields

§value: String
§reason: &'static str
§

TypeFileMismatch

Fields

§declared: Vec<String>
§found: Vec<String>
§

TypeNameMismatch

Fields

§file: String
§declared: String
§

PropagatingRelationshipsRenamed

The retired propagating_relationships: key was used in an authoring context (a schema package loaded from a directory — workspace .memstead/schemas/, schema install, schema validate). The key’s name promised propagation the engine never performed; its only effect — refusing self-loops on the listed rel-types — now lives under no_self_loop_relationships. Sealed content (built-ins, installed refs) keeps loading with the old key translated; only authoring refuses, so the fix is one mechanical key rename per schema.

Fields

§type_name: String
§

ExamplesRetired

Fields

§type_name: String
§

OptionalRetired

The retired optional: metadata-field key was used in an authoring context. The polarity flipped (first-author-path plan 07): a field is optional unless it declares required: true — the same rule sections follow. Sealed content keeps loading with the old key inverted; only authoring refuses, so the fix is one mechanical edit.

Fields

§type_name: String
§field: String
§

InvalidDueAxis

A due: declaration referencing fields the type does not have in the required shapes. offender names the bad reference, reason states the shape rule it violates — the due axis is spec (an external declaration), so its references validate at load with the loader’s usual recovery quality.

Fields

§type_name: String
§offender: String
§reason: String
§

MissingDefaultWeight

§

DuplicateRelationship

Fields

§name: String
§

UndeclaredRelationship

Fields

§type_name: String
§field: &'static str
§relationship: String
§available: Vec<String>
§

CatchAllViolation

Fields

§type_name: String
§count: usize
§

UnknownFieldReference

Fields

§type_name: String
§field: &'static str
§reference: String
§

InvalidConstraint

Fields

§type_name: String
§kind: &'static str
§offender: String
§reason: String
§

InvalidSectionFormat

Fields

§type_name: String
§section: String
§problems: Vec<String>

EVERY problem of the section’s declaration — the loader names all offenders, never the first only, so one repair pass fixes the schema.

§

DefaultValueNotInEnum

Fields

§type_name: String
§field: String
§default: String
§allowed: Vec<String>
§

RedeclaredBaseField

Fields

§type_name: String
§field: String
§

UndeclaredRelationshipType

Fields

§relationship: String
§field: &'static str
§reference: String
§declared: Vec<String>
§

ReservedSchemaKey

Schema declares a regular section or metadata field whose key collides with an engine-invariant key. The reserved set covers section key relationships (the parser’s auto-managed ## Relationships section) and the metadata identity/ discriminator triple type / mem / id (reserved_metadata_field_keys). Sections refuse at load; metadata keys refuse on the install/strict-validation path (check_reserved_metadata_keys) so sealed schemas keep booting.

Fields

§type_name: String
§kind: &'static str
§offending_key: String
§reserved_keys: Vec<String>
§

InvalidCrossMemToSchema

A cross_mem_relationships: entry’s to_schema: field is not a bare schema name. Cross-mem eligibility is name-based — versioned (software@1.0.0) and range (software@^1.0) forms are refused so a version component can never silently re-enter the eligibility path.

Fields

§value: String
§reason: String
§

DuplicateCrossMemToSchema

Two cross_mem_relationships: entries declare the same to_schema:. A schema declares each target-schema at most once — the second entry would otherwise silently shadow or split the vocabulary.

Fields

§to_schema: String
§

SealedPackageMissingManifest

A sealed package’s file list carries no schema.yaml. Only reachable through load_sealed_package — the directory loader surfaces a missing manifest as Self::Io instead.

§

CrossMemWildcardWithoutAliasTarget

A to_schema: "*" wildcard entry in a schema that declares no alias_target_rel_type. The wildcard is BOUND to the alias-synthesised rel-type — a schema that has not opted into alias synthesis has made no decision the wildcard could extend.

§

CrossMemWildcardNonAliasRelType

A to_schema: "*" wildcard entry declaring a rel-type other than the schema’s alias_target_rel_type. Hand-authored structural edges keep requiring a per-destination-schema declaration — the wildcard only extends the soft, auto-emitted alias references the author already permitted.

Fields

§rel_type: String
§alias_target: String
§

UndeclaredCrossMemSourceType

A cross_mem_relationships[].definitions[*].source_types entry references a type name not declared in the source schema’s types list. Source types belong to the source schema’s namespace; unknown names raise this error at load time. (Target types are accepted as opaque strings — they belong to the target schema’s namespace, which is not in scope here.)

Fields

§to_schema: String
§relationship: String
§reference: String
§declared: Vec<String>
§

AliasTargetRelTypeNotDeclared

The schema’s alias_target_rel_type: pointer names a rel-type not declared in relationships.definitions. Surfaces at schema-load time so the alias-synthesis pass can trust the pointer is resolvable at every later mutation call.

Fields

§schema: String
§target: String
§declared: Vec<String>
§

SectionHeadingMismatch

One or more declared section headings do not derive back to their declared keys (derive_section_key(heading) != key), so content written under the heading could never be parsed back into the section — it would silently fork into a second heading or fall through to the catch-all. Raised by check_section_heading_roundtrip on the authoring/installation path only; a schema already sealed into a mem-repo keeps loading and surfaces the condition through health instead.

Fields

§

Multiple

Two or more independent semantic violations found in one load pass. The loader accumulates every violation it can prove on successfully parsed structure and refuses once, so the author fixes the whole set in one edit instead of one violation per validate round. Structural failures (a manifest that does not parse, a declared-vs-found type-file mismatch) still short-circuit — everything downstream of them would be noise derived from a value that does not exist. A single violation is returned bare, never as a one-element list.

Fields

Trait Implementations§

Source§

impl Debug for SchemaLoadError

Source§

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

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

impl Display for SchemaLoadError

Source§

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

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

impl Error for SchemaLoadError

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

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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.