Debian Codegraph @

src/common/error.rs

raw symbols SCIP
1 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::{convertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/, errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std error/, fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/, iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/, resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/};
2
3 /// A list specifying general categories of LZ4 error.
4 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:, Hashrust-analyzer cargo core https://github.com/rust-lang/rust/library/core hash/macros/Hash:)]
5 #[non_exhaustive]
6 pub enum ErrorKindrust-analyzer cargo lzzzz 2.0.0 common/error/ErrorKind# {
7 /// The state initialization failed for some reason.
8 InitializationFailedrust-analyzer cargo lzzzz 2.0.0 common/error/ErrorKind#InitializationFailed#,
9 /// The compression failed for some reason.
10 CompressionFailedrust-analyzer cargo lzzzz 2.0.0 common/error/ErrorKind#CompressionFailed#,
11 /// The decompression failed for some reason.
12 DecompressionFailedrust-analyzer cargo lzzzz 2.0.0 common/error/ErrorKind#DecompressionFailed#,
13 /// The frame header had an invalid value.
14 FrameHeaderInvalidrust-analyzer cargo lzzzz 2.0.0 common/error/ErrorKind#FrameHeaderInvalid#,
15 /// The decompressor reached unexpected EOF.
16 CompressedDataIncompleterust-analyzer cargo lzzzz 2.0.0 common/error/ErrorKind#CompressedDataIncomplete#,
17 /// Dictionary data was not consistent during the streaming decompression.
18 DictionaryChangedDuringDecompressionrust-analyzer cargo lzzzz 2.0.0 common/error/ErrorKind#DictionaryChangedDuringDecompression#,
19 }
20
21 impl fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display# for ErrorKindrust-analyzer cargo lzzzz 2.0.0 common/error/ErrorKind# {
22 fn fmtrust-analyzer cargo lzzzz 2.0.0 common/error/impl#[ErrorKind][Display]fmt().(&self, f: &mut fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#<'_>) -> resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Error#> {
23 <Selfrust-analyzer cargo lzzzz 2.0.0 common/error/impl#[ErrorKind][Display] as fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug#>::fmtrust-analyzer cargo lzzzz 2.0.0 common/error/impl#[ErrorKind][Debug]fmt().(self, f)
24 }
25 }
26
27 /// The error type for LZ4 operations.
28 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:, Hashrust-analyzer cargo core https://github.com/rust-lang/rust/library/core hash/macros/Hash:)]
29 pub struct Errorrust-analyzer cargo lzzzz 2.0.0 common/error/Error# {
30 kindrust-analyzer cargo lzzzz 2.0.0 common/error/Error#kind.: ErrorKindrust-analyzer cargo lzzzz 2.0.0 common/error/ErrorKind#,
31 }
32
33 impl Errorrust-analyzer cargo lzzzz 2.0.0 common/error/Error# {
34 pub(craterust-analyzer cargo lzzzz 2.0.0 crate/) const fn newrust-analyzer cargo lzzzz 2.0.0 common/error/impl#[Error]new().(kind: ErrorKindrust-analyzer cargo lzzzz 2.0.0 common/error/ErrorKind#) -> Selfrust-analyzer cargo lzzzz 2.0.0 common/error/impl#[Error] {
35 Selfrust-analyzer cargo lzzzz 2.0.0 common/error/impl#[Error] { kindrust-analyzer cargo lzzzz 2.0.0 common/error/Error#kind. }
36 }
37
38 /// Returns the corresponding `ErrorKind` for this error.
39 pub const fn kindrust-analyzer cargo lzzzz 2.0.0 common/error/impl#[Error]kind().(self) -> ErrorKindrust-analyzer cargo lzzzz 2.0.0 common/error/ErrorKind# {
40 self.kindrust-analyzer cargo lzzzz 2.0.0 common/error/Error#kind.
41 }
42 }
43
44 impl convertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/::Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<Errorrust-analyzer cargo lzzzz 2.0.0 common/error/Error#> for iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Error# {
45 fn fromrust-analyzer cargo lzzzz 2.0.0 common/error/impl#[`io::Error`][`From<Error>`]from().(err: Errorrust-analyzer cargo lzzzz 2.0.0 common/error/Error#) -> Selfrust-analyzer cargo lzzzz 2.0.0 common/error/impl#[`io::Error`][`From<Error>`] {
46 Selfrust-analyzer cargo lzzzz 2.0.0 common/error/impl#[`io::Error`][`From<Error>`]::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/impl#[Error]new().(iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::ErrorKindrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#::Otherrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#Other#, err)
47 }
48 }
49
50 impl fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display# for Errorrust-analyzer cargo lzzzz 2.0.0 common/error/Error# {
51 fn fmtrust-analyzer cargo lzzzz 2.0.0 common/error/impl#[Error][Display]fmt().(&self, f: &mut fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#<'_>) -> resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Error#> {
52 <ErrorKindrust-analyzer cargo lzzzz 2.0.0 common/error/ErrorKind# as fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display#>::fmtrust-analyzer cargo lzzzz 2.0.0 common/error/impl#[ErrorKind][Display]fmt().(&self.kindrust-analyzer cargo lzzzz 2.0.0 common/error/Error#kind., f)
53 }
54 }
55
56 impl errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std error/::Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error# for Errorrust-analyzer cargo lzzzz 2.0.0 common/error/Error# {}
57
58 /// A specialized [`Result`] type for LZ4 operations.
59 ///
60 /// [`Result`]: https://doc.rust-lang.org/std/result/enum.Result.html
61 pub type Resultrust-analyzer cargo lzzzz 2.0.0 common/error/Result#<T> = resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<T, Errorrust-analyzer cargo lzzzz 2.0.0 common/error/Error#>;