Module error

Module error 

Source
Expand description

Error types for IPFRS operations.

This module provides a unified error type (Error) and result alias (Result) used throughout the IPFRS crate family.

§Error Categories

Errors are categorized by their source:

  • I/O errors - File system and network I/O failures
  • Data errors - Invalid blocks, CIDs, or serialization issues
  • Not found - Missing blocks, peers, or resources
  • Protocol errors - IPFS protocol violations

§Example

use ipfrs_core::{Error, Result, Block};
use bytes::Bytes;

fn process_block(data: &[u8]) -> Result<Block> {
    if data.is_empty() {
        return Err(Error::InvalidInput("empty data".to_string()));
    }
    Block::new(Bytes::copy_from_slice(data))
}

Enums§

Error
Unified error type for IPFRS operations.

Type Aliases§

Result
Convenient result type for IPFRS operations.