Skip to main content

InterchangeError

Enum InterchangeError 

Source
pub enum InterchangeError {
Show 18 variants Metadata { position: usize, source: Error, }, Xml { source: Error, }, NotMspdi { found: String, }, MalformedProject { reason: String, }, MalformedTask { position: usize, reason: String, }, OutlineOrder { uid: i64, source: OrderError, }, DuplicateUid { uid: i64, }, DuplicateIdentity { first: i64, second: i64, identity: String, }, SourceScopeRequired { count: usize, first_uid: i64, }, AmbiguousMatch { ambiguities: Vec<String>, }, UnknownProject { key: String, }, KeyCollision { key: String, uid: i64, }, KindChange { uid: i64, guid: Option<String>, key: String, from: WorkKind, to: WorkKind, }, Refused { change: SourceChange, source: Box<dyn Error + Send + Sync + 'static>, }, RefusedLink { change: Box<SourceLinkChange>, source: Box<dyn Error + Send + Sync + 'static>, }, InvalidTimeZone { time_zone: String, }, TimeZoneMismatch { workspace: String, requested: String, }, Unrepresentable { key: String, reason: String, },
}
Expand description

Interchange failure; every variant leaves the workspace untouched because imports only build a candidate for review.

Variants§

§

Metadata

A namespaced DPM metadata value is malformed.

Fields

§position: usize

One-based task position.

§source: Error

Original JSON diagnostic.

§

Xml

The document is not well-formed XML.

Fields

§source: Error

Parser diagnostic with position.

§

NotMspdi

The root element is not a Microsoft Project XML project.

Fields

§found: String

Qualified name of the root element found.

§

MalformedProject

A project-level element violates the MSPDI structure DPM relies on.

Fields

§reason: String

Violated structural rule.

§

MalformedTask

A task or link element violates the MSPDI structure DPM relies on.

Fields

§position: usize

One-based position of the task element in the document.

§reason: String

Violated structural rule.

§

OutlineOrder

The imported outline cannot be assigned a valid sibling position.

Fields

§uid: i64

Source task UID.

§source: OrderError

Position allocation failure.

§

DuplicateUid

Two task elements share a unique identifier.

Fields

§uid: i64

Repeated source UID.

§

DuplicateIdentity

Two task elements resolve to the same local work identity.

Fields

§first: i64

First task UID.

§second: i64

Second task UID.

§identity: String

Shared identity.

§

SourceScopeRequired

Neither the document nor some of its tasks carry a GUID, and the import names no source.

Fields

§count: usize

Imported tasks without a GUID.

§first_uid: i64

First such task UID in document order.

§

AmbiguousMatch

Matching GUID-less tasks to existing work by title path is not unique.

Fields

§ambiguities: Vec<String>

Every ambiguous task or path, with the local work keys involved.

§

UnknownProject

The requested project key does not exist in the workspace.

Fields

§key: String

Requested project key.

§

KeyCollision

A generated key is already used by other work.

Fields

§key: String

Generated work key.

§uid: i64

Source task UID.

§

KindChange

A source task would change the kind of existing work, which reviewed plan changes forbid.

Fields

§uid: i64

Source task UID.

§guid: Option<String>

Source task GUID, when present.

§key: String

Existing work key.

§from: WorkKind

Local kind.

§to: WorkKind

Kind the source implies.

§

Refused

Review refused the candidate at work that a source task maps to.

Fields

§change: SourceChange

Source task and the changes it attempts.

§source: Box<dyn Error + Send + Sync + 'static>

Review refusal naming only local work.

Review refused the candidate at a dependency that a source link maps to, or that the candidate removes because the document omits the link.

Fields

§change: Box<SourceLinkChange>

Source link and the change it attempts.

§source: Box<dyn Error + Send + Sync + 'static>

Review refusal naming only the dependency identity.

§

InvalidTimeZone

The time zone given for the document’s calendars is not an IANA time zone name.

Fields

§time_zone: String

Requested time zone.

§

TimeZoneMismatch

The workspace already reads its calendars in another time zone.

Fields

§workspace: String

Time zone of the workspace calendars.

§requested: String

Time zone given for the document.

§

Unrepresentable

A value cannot be written as MSPDI.

Fields

§key: String

Work key.

§reason: String

Reason the value has no MSPDI form.

Implementations§

Source§

impl InterchangeError

Source

pub fn code(&self) -> &'static str

Stable machine category shared by the CLI and agent adapters.

Trait Implementations§

Source§

impl Debug for InterchangeError

Source§

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

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

impl Display for InterchangeError

Source§

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

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

impl Error for InterchangeError

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> Same for T

Source§

type Output = T

Should always be Self
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.