Skip to main content

Error

Enum Error 

Source
pub enum Error {
Show 14 variants NoRepository, Config { path: RepoPath, message: String, }, FormatsFile { path: RepoPath, message: String, }, Path(String), Init(String), Harness(String), New(String), Info(String), Start(String), Guide(String), Locate(String), Query(String), Io { path: PathBuf, source: Error, }, Internal(String),
}
Expand description

Error holds the errors of this crate. Every variant renders a message that the CLI prints unchanged after error: .

Variants§

§

NoRepository

The tool finds no repository root (CLI-1_AC-5).

§

Config

The tool refuses a config.toml file (CONF-1_AC-3, CONF-1_AC-4, CONF-2_AC-6, CONF-2_AC-7, CONF-3_AC-5, CONF-3_AC-6), or a file of texts (CONF-12_AC-3, CONF-12_AC-4, CONF-12_AC-5).

Fields

§path: RepoPath

path is the path of the configuration file that the tool refuses.

§message: String

The message says what is wrong with the file.

§

FormatsFile

The tool refuses a formats.yaml file.

Fields

§path: RepoPath

path is the path of the formats file that the tool refuses.

§message: String

The message says what is wrong with the file.

§

Path(String)

The tool refuses a PATHS argument whose path is not in the repository (CLI-4_AC-15).

§

Init(String)

init refuses to run (contract-cli CLI-2), and the message identifies the path or the option at fault.

§

Harness(String)

harness refuses to run (contract-cli CLI-3), and the message identifies the harness, part, event, or file at fault.

§

New(String)

new refuses to run (contract-cli CLI-6).

§

Info(String)

info refuses to run (contract-cli CLI-5).

§

Start(String)

graph refuses a START argument, and the message lists each way the tool can read the argument (CLI-7_AC-19).

§

Guide(String)

guide refuses an argument, a document, or a --state (contract-cli CLI-17), and the message names the argument or the document.

§

Locate(String)

locate refuses an id, and the message gives the id and the paths of the documents that declare it (CLI-8_AC-6).

§

Query(String)

A JMESPath expression doesn’t compile (CLI-4_AC-17, CLI-7_AC-21).

§

Io

An input or output (I/O) operation fails at a path.

Fields

§path: PathBuf

path is the path at which the operation fails.

§source: Error

source is the I/O error that causes the failure.

§

Internal(String)

The code breaks one of its own invariants.

Implementations§

Source§

impl Error

Source

pub fn io(path: impl Into<PathBuf>, source: Error) -> Self

io builds an Error::Io for path from a std::io::Error.

Source

pub fn config(path: RepoPath, message: impl Into<String>) -> Self

config builds an Error::Config.

Source

pub fn formats(path: RepoPath, message: impl Into<String>) -> Self

formats builds an Error::FormatsFile.

Trait Implementations§

Source§

impl Debug for Error

Source§

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

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

impl Display for Error

Source§

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

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

impl Error for Error

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

Replaced by Error::source.
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<Error> for Error

Source§

fn from(e: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

An error of agent-harness-adapter is an I/O error at its path, or else a refusal of harness.

Source§

fn from(e: Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Error

§

impl !UnwindSafe for Error

§

impl Forget for Error

§

impl Freeze for Error

§

impl Move for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnsafeUnpin for Error

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> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<'a, T> FromIn<'a, T> for T

Source§

fn from_in(t: T, _: &'a Allocator) -> T

Converts to this type from the input type within the given allocator.
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<'a, T, U> IntoIn<'a, U> for T
where U: FromIn<'a, T>,

Source§

fn into_in(self, allocator: &'a Allocator) -> U

Converts this type into the (usually inferred) input type within the given allocator.
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, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(_simd: S, value: T) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

impl<T> ToCompactString for T
where T: Display,

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.