Skip to main content

Error

Enum Error 

Source
pub enum Error {
Show 24 variants CurrentDir { source: Error, }, NormalizePath { path: PathBuf, source: Error, }, NotGitWorktree, GitIo { command: String, source: Error, }, GitFailed { command: String, stderr: String, }, RootPathNotFound, ConfigNotFound(PathBuf), ConfigIo { path: PathBuf, source: Error, }, ConfigParse { path: PathBuf, message: String, }, ConfigInvalid { path: PathBuf, message: String, }, InvalidBooleanEnv { name: &'static str, value: String, }, NoConfigDetectedStrict, RootWorktreeStrict, CommandIo { label: String, source: Error, }, CommandFailed { label: String, status: ExitStatus, }, FileOperationConflict { operation: &'static str, path: PathBuf, message: String, }, FileOperationInvalid { operation: &'static str, message: String, }, FileOperationIo { operation: &'static str, path: PathBuf, source: Error, }, ScriptIo { path: PathBuf, source: Error, }, ScriptFailed { path: PathBuf, status: ExitStatus, }, Output { source: Error, }, DoctorFailed, InitTargetExists(PathBuf), InitIo { path: PathBuf, source: Error, },
}
Expand description

Error type for treeboot-core operations.

Variants§

§

CurrentDir

The current working directory could not be read.

Fields

§source: Error

Source I/O error.

§

NormalizePath

A filesystem path could not be normalized.

Fields

§path: PathBuf

Path that failed normalization.

§source: Error

Source I/O error.

§

NotGitWorktree

The command was not run from a Git worktree.

§

GitIo

A Git command could not be spawned.

Fields

§command: String

Human-readable command label.

§source: Error

Source I/O error.

§

GitFailed

A Git command exited unsuccessfully.

Fields

§command: String

Human-readable command label.

§stderr: String

Standard error from Git.

§

RootPathNotFound

No root checkout path could be determined.

§

ConfigNotFound(PathBuf)

A specifically requested config file does not exist.

§

ConfigIo

A config file could not be read.

Fields

§path: PathBuf

Config file path.

§source: Error

Source I/O error.

§

ConfigParse

A config file contains invalid TOML.

Fields

§path: PathBuf

Config file path.

§message: String

Parse error message.

§

ConfigInvalid

A config file contains unsupported or invalid declarations.

Fields

§path: PathBuf

Config file path.

§message: String

Validation error message.

§

InvalidBooleanEnv

A treeboot boolean environment variable has an unsupported value.

Fields

§name: &'static str

Environment variable name.

§value: String

Environment variable value.

§

NoConfigDetectedStrict

No config was found while strict mode was enabled.

§

RootWorktreeStrict

The command was run from the root checkout while strict mode was enabled.

§

CommandIo

A configured command could not be spawned.

Fields

§label: String

Human-readable command label.

§source: Error

Source I/O error.

§

CommandFailed

A configured command exited unsuccessfully.

Fields

§label: String

Human-readable command label.

§status: ExitStatus

Process exit status.

§

FileOperationConflict

A file operation encountered an unsupported conflict.

Fields

§operation: &'static str

Operation being applied.

§path: PathBuf

Path involved in the conflict.

§message: String

Human-readable conflict detail.

§

FileOperationInvalid

A manual file operation request is invalid.

Fields

§operation: &'static str

Operation being planned.

§message: String

Human-readable validation detail.

§

FileOperationIo

A file operation failed while accessing the filesystem.

Fields

§operation: &'static str

Operation being applied.

§path: PathBuf

Path being accessed.

§source: Error

Source I/O error.

§

ScriptIo

An init script could not be spawned.

Fields

§path: PathBuf

Script path.

§source: Error

Source I/O error.

§

ScriptFailed

An init script exited unsuccessfully.

Fields

§path: PathBuf

Script path.

§status: ExitStatus

Script process status.

§

Output

Writing output failed.

Fields

§source: Error

Source I/O error.

§

DoctorFailed

Doctor diagnostics found fatal issues.

§

InitTargetExists(PathBuf)

treeboot init refused to replace an existing target.

§

InitIo

An init file could not be written.

Fields

§path: PathBuf

Init target path.

§source: Error

Source I/O error.

Implementations§

Source§

impl Error

Source

pub const fn exit_code(&self) -> u8

Returns the CLI exit code associated with this error.

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

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§

§

impl !RefUnwindSafe for Error

§

impl !UnwindSafe for Error

§

impl Freeze 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> 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> 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> 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.