ParcodeError

Enum ParcodeError 

Source
pub enum ParcodeError {
    Io(Arc<Error>),
    Serialization(String),
    Compression(String),
    Format(String),
    Internal(String),
}
Expand description

The master error enum covering all failure domains in Parcode.

This enum represents all possible error conditions that can occur during Parcode operations. Each variant corresponds to a specific failure domain and contains contextual information about the error.

§Variants

  • Io: Low-level I/O failures (file not found, permission denied, disk full, etc.)
  • Serialization: Bincode encoding/decoding failures (type mismatch, invalid data, etc.)
  • Compression: Compression algorithm failures (corrupted compressed data, etc.)
  • Format: File format validation failures (wrong magic bytes, version mismatch, corruption)
  • Internal: Logic errors in the library (should not occur in production; please report as bugs)

§Cloneability

This type is Clone to support error sharing across threads and storage for later analysis. I/O errors are wrapped in Arc to make cloning efficient.

§Examples

use parcode::ParcodeError;

fn check_error(err: &ParcodeError) {
    match err {
        ParcodeError::Io(e) => println!("I/O error: {}", e),
        ParcodeError::Format(msg) => println!("Format error: {}", msg),
        _ => println!("Other error"),
    }
}

Variants§

§

Io(Arc<Error>)

Low-level I/O failure (disk full, permissions, network errors, etc.).

The underlying io::Error is wrapped in an Arc to make the error Clone. This allows errors to be shared across threads without expensive copying.

§Common Causes
  • File not found
  • Permission denied
  • Disk full
  • Network interruption (for network file systems)
  • Hardware failure
§

Serialization(String)

Serialization or deserialization failure (bincode).

This error occurs when bincode cannot encode or decode data, typically due to:

  • Type mismatches between serialized and deserialized types
  • Invalid or corrupted serialized data
  • Unsupported types or features

The string contains a detailed error message from bincode.

§

Compression(String)

Compression algorithm failure.

This error occurs when compression or decompression fails, typically due to:

  • Corrupted compressed data
  • Unsupported compression algorithm ID
  • Compression buffer overflow

The string contains a detailed error message from the compression library.

§

Format(String)

The file format is invalid, corrupted, or has a version mismatch.

This error occurs when the file does not conform to the Parcode V4 format:

  • Wrong magic bytes (not “PAR4”)
  • Unsupported version number
  • Truncated file (missing header or chunks)
  • Corrupted chunk metadata
  • Invalid child references

The string contains a detailed description of the format violation.

§

Internal(String)

Logic error in the graph scheduler or other internal components.

This error should not occur in production. If you encounter this error, it likely indicates a bug in the library. Please report it with a minimal reproduction case.

§Common Causes (all indicate bugs)
  • Cyclic dependencies in the graph
  • Mutex poisoning
  • Invalid node IDs
  • Missing child results

The string contains diagnostic information about the internal error.

Trait Implementations§

Source§

impl Clone for ParcodeError

Source§

fn clone(&self) -> ParcodeError

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ParcodeError

Source§

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

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

impl Display for ParcodeError

Source§

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

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

impl Error for ParcodeError

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
Source§

impl From<Error> for ParcodeError

Source§

fn from(err: Error) -> Self

Converts to this type from the input type.

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V