[−][src]Enum wix::Error
The error type for wix-related operations and associated traits.
Errors mostly originate from the dependencies, but custom instances of Error
can be created
with the Generic
variant and a message.
Variants
A command operation failed.
Generic(String)
A generic or custom error occurred. The message should contain the detailed information.
Io(Error)
An I/O operation failed.
Manifest(&'static str)
A needed field within the Cargo.toml
manifest could not be found.
Mustache(Error)
An error occurred with rendering the template using the mustache renderer.
Toml(Error)
Parsing of the Cargo.toml
manifest failed.
Version(SemVerError)
Parsing error for a version string or field.
Implementations
impl Error
[src]
pub fn code(&self) -> i32
[src]
Gets an error code related to the error.
Examples
extern crate wix; use wix::Error; fn main() { let err = Error::from("A generic error"); assert_ne!(err.code(), 0) }
This is useful as a return, or exit, code for a command line application, where a non-zero integer indicates a failure in the application. it can also be used for quickly and easily testing equality between two errors.
pub fn already_exists(p: &Path) -> Self
[src]
Creates a new Error
from a std::io::Error with the
std::io::ErrorKind::AlreadyExists variant.
Examples
extern crate wix; use std::io; use std::path::Path; use wix::Error; fn main() { let path = Path::new("C:\\"); let expected = Error::Io(io::Error::new( io::ErrorKind::AlreadyExists, path.display().to_string() )); assert_eq!(expected, Error::already_exists(path)); }
pub fn not_found(p: &Path) -> Self
[src]
Creates a new Error
from a std::io::Error with the
std::io::ErrorKind::NotFound variant.
Examples
extern crate wix; use std::io; use std::path::Path; use wix::Error; fn main() { let path = Path::new("C:\\Cargo\\Wix\\file.txt"); let expected = Error::Io(io::Error::new( io::ErrorKind::NotFound, path.display().to_string() )); assert_eq!(expected, Error::not_found(path)); }
Trait Implementations
impl Debug for Error
[src]
impl Display for Error
[src]
impl Error for Error
[src]
fn description(&self) -> &str
[src]
fn cause(&self) -> Option<&dyn StdError>
[src]
fn source(&self) -> Option<&(dyn Error + 'static)>
1.30.0[src]
fn backtrace(&self) -> Option<&Backtrace>
[src]
impl<'a> From<&'a str> for Error
[src]
impl From<Error> for Error
[src]
impl From<Error> for Error
[src]
impl From<Error> for Error
[src]
impl From<SemVerError> for Error
[src]
fn from(err: SemVerError) -> Self
[src]
impl From<StripPrefixError> for Error
[src]
fn from(err: StripPrefixError) -> Self
[src]
impl PartialEq<Error> for Error
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,