pub enum FileError {
LinksAndBlocksizesMismatch,
NoLinksNoContent,
NonRootDefinesMetadata(Metadata),
IntermediateNodeWithoutFileSize,
TreeExpandsOnLinks,
TreeOverlapsBetweenLinks,
EarlierLink,
TreeJumpsBetweenLinks,
UnexpectedRawOrFileProperties {
hash_type: Option<u64>,
fanout: Option<u64>,
},
}
Expand description
Errors which can happen while processing UnixFS type File or Raw blocks.
Variants§
LinksAndBlocksizesMismatch
There are nonequal number of links and blocksizes and thus the file ranges for linked trees or blocks cannot be determined.
NoLinksNoContent
Errored when the filesize is non-zero.
NonRootDefinesMetadata(Metadata)
Unsupported: non-root block defines metadata.
IntermediateNodeWithoutFileSize
A non-leaf node in the tree has no filesize value which is used to determine the file range for this tree.
TreeExpandsOnLinks
The tree or merkle dag should only collapse or stay the same length.
TreeOverlapsBetweenLinks
The tree links contain overlapping file segments. This is at least unsupported right now, but the larger segment could be collapsed down to the reused part.
EarlierLink
Reader has been fed a link to earlier range.
TreeJumpsBetweenLinks
The tree links contain a hole from a file segment to the next tree. This is at least unsupported right now. Zeroes could be generated for the hole.
UnexpectedRawOrFileProperties
These values should not be present for unixfs files with File or Raw. If they have a valid meaning, support for such has not been implemented.
Trait Implementations§
Source§impl Error for FileError
impl Error for FileError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<FileError> for FileReadFailed
impl From<FileError> for FileReadFailed
impl Eq for FileError
impl StructuralPartialEq for FileError
Auto Trait Implementations§
impl Freeze for FileError
impl RefUnwindSafe for FileError
impl Send for FileError
impl Sync for FileError
impl Unpin for FileError
impl UnwindSafe for FileError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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