Something went wrong. Try again.
STreaming ARchive format: simpler, stricter, smaller than CARs for a subset of use-cases. forked from microcosm.blue/star
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647use cid::Cid;use std::io;use thiserror::Error;
#[derive(Debug)]pub enum VerificationKind { Node, Record { key: Vec<u8> },}
#[derive(Error, Debug)]pub enum StarError { #[error("IO error: {0}")] Io(#[from] io::Error), #[error("CBOR error: {0}")] Cbor(String), #[error("CID error: {0}")] Cid(#[from] cid::Error), #[error("Multihash error: {0}")] Multihash(#[from] cid::multihash::Error), #[error("Invalid STAR header")] InvalidHeader, #[error("Unexpected EOF")] UnexpectedEof,
#[error("Verification failed for {kind:?}: expected {expected}, got {computed}")] VerificationFailed { kind: VerificationKind, expected: Box<Cid>, computed: Box<Cid>, },
#[error("Invalid state: {0}")] InvalidState(String),
#[error("Invalid structure: {0}")] InvalidStructure(String),
#[error("Height mismatch: found {found}, expected {expected}")] HeightMismatch { found: u32, expected: u32 },
#[error("Trailing data")] TrailingData,}
pub type Result<T> = std::result::Result<T, StarError>;