| 1 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::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#; |
| 2 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/; |
| 3 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/; |
| 4 | use ffirust-analyzer cargo yaml 0.3.0 ffi/; |
| 5 | use ffirust-analyzer cargo yaml 0.3.0 ffi/::YamlErrorTyperust-analyzer cargo yaml 0.3.0 ffi/YamlErrorType#; |
| 6 | |
| 7 | #[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:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:)] |
| 8 | pub struct YamlMarkrust-analyzer cargo yaml 0.3.0 error/YamlMark# { |
| 9 | pub indexrust-analyzer cargo yaml 0.3.0 error/YamlMark#index.: usize, |
| 10 | pub linerust-analyzer cargo yaml 0.3.0 error/YamlMark#line.: usize, |
| 11 | pub columnrust-analyzer cargo yaml 0.3.0 error/YamlMark#column.: usize |
| 12 | } |
| 13 | |
| 14 | impl YamlMarkrust-analyzer cargo yaml 0.3.0 error/YamlMark# { |
| 15 | pub fn convrust-analyzer cargo yaml 0.3.0 error/impl#[YamlMark]conv().(mark: &ffirust-analyzer cargo yaml 0.3.0 ffi/::yaml_mark_trust-analyzer cargo yaml 0.3.0 ffi/yaml_mark_t#) -> YamlMarkrust-analyzer cargo yaml 0.3.0 error/YamlMark# { |
| 16 | YamlMarkrust-analyzer cargo yaml 0.3.0 error/YamlMark# { |
| 17 | indexrust-analyzer cargo yaml 0.3.0 error/YamlMark#index.: mark.indexrust-analyzer cargo yaml 0.3.0 ffi/yaml_mark_t#index. as usize, |
| 18 | linerust-analyzer cargo yaml 0.3.0 error/YamlMark#line.: mark.linerust-analyzer cargo yaml 0.3.0 ffi/yaml_mark_t#line. as usize, |
| 19 | columnrust-analyzer cargo yaml 0.3.0 error/YamlMark#column.: mark.columnrust-analyzer cargo yaml 0.3.0 ffi/yaml_mark_t#column. as usize |
| 20 | } |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | #[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:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:)] |
| 25 | pub struct YamlErrorContextrust-analyzer cargo yaml 0.3.0 error/YamlErrorContext# { |
| 26 | pub byte_offsetrust-analyzer cargo yaml 0.3.0 error/YamlErrorContext#byte_offset.: usize, |
| 27 | pub problem_markrust-analyzer cargo yaml 0.3.0 error/YamlErrorContext#problem_mark.: YamlMarkrust-analyzer cargo yaml 0.3.0 error/YamlMark#, |
| 28 | pub contextrust-analyzer cargo yaml 0.3.0 error/YamlErrorContext#context.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>, |
| 29 | pub context_markrust-analyzer cargo yaml 0.3.0 error/YamlErrorContext#context_mark.: YamlMarkrust-analyzer cargo yaml 0.3.0 error/YamlMark# |
| 30 | } |
| 31 | |
| 32 | #[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:)] |
| 33 | pub struct YamlErrorrust-analyzer cargo yaml 0.3.0 error/YamlError# { |
| 34 | pub kindrust-analyzer cargo yaml 0.3.0 error/YamlError#kind.: YamlErrorTyperust-analyzer cargo yaml 0.3.0 ffi/YamlErrorType#, |
| 35 | pub problemrust-analyzer cargo yaml 0.3.0 error/YamlError#problem.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>, |
| 36 | pub io_errorrust-analyzer cargo yaml 0.3.0 error/YamlError#io_error.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<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#>, |
| 37 | pub contextrust-analyzer cargo yaml 0.3.0 error/YamlError#context.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<YamlErrorContextrust-analyzer cargo yaml 0.3.0 error/YamlErrorContext#> |
| 38 | } |
| 39 | |
| 40 | impl PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq# for YamlErrorrust-analyzer cargo yaml 0.3.0 error/YamlError# { |
| 41 | fn eqrust-analyzer cargo yaml 0.3.0 error/impl#[YamlError][`PartialEq<Self>`]eq().(&self, rhs: &YamlErrorrust-analyzer cargo yaml 0.3.0 error/YamlError#) -> bool { |
| 42 | self.kindrust-analyzer cargo yaml 0.3.0 error/YamlError#kind. rust-analyzer cargo yaml 0.3.0 ffi/impl#[YamlErrorType][`PartialEq<Self>`]eq().==rust-analyzer cargo yaml 0.3.0 ffi/impl#[YamlErrorType][`PartialEq<Self>`]eq(). rust-analyzer cargo yaml 0.3.0 ffi/impl#[YamlErrorType][`PartialEq<Self>`]eq().rhs.kindrust-analyzer cargo yaml 0.3.0 error/YamlError#kind. |
| 43 | && self.problemrust-analyzer cargo yaml 0.3.0 error/YamlError#problem. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`][`PartialEq<Self>`]eq().rhs.problemrust-analyzer cargo yaml 0.3.0 error/YamlError#problem. |
| 44 | && self.io_errorrust-analyzer cargo yaml 0.3.0 error/YamlError#io_error..is_nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_none().() |
| 45 | && rhs.io_errorrust-analyzer cargo yaml 0.3.0 error/YamlError#io_error..is_nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_none().() |
| 46 | && self.contextrust-analyzer cargo yaml 0.3.0 error/YamlError#context. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`][`PartialEq<Self>`]eq().rhs.contextrust-analyzer cargo yaml 0.3.0 error/YamlError#context. |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | impl Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error# for YamlErrorrust-analyzer cargo yaml 0.3.0 error/YamlError# { |
| 51 | fn descriptionrust-analyzer cargo yaml 0.3.0 error/impl#[YamlError][Error]description().(&self) -> &str { |
| 52 | match self.kindrust-analyzer cargo yaml 0.3.0 error/YamlError#kind. { |
| 53 | YamlErrorTyperust-analyzer cargo yaml 0.3.0 ffi/YamlErrorType#::YAML_NO_ERRORrust-analyzer cargo yaml 0.3.0 ffi/YamlErrorType#YAML_NO_ERROR# => "No error is produced", |
| 54 | YamlErrorTyperust-analyzer cargo yaml 0.3.0 ffi/YamlErrorType#::YAML_MEMORY_ERRORrust-analyzer cargo yaml 0.3.0 ffi/YamlErrorType#YAML_MEMORY_ERROR# => "Cannot allocate or reallocate a block of memory", |
| 55 | YamlErrorTyperust-analyzer cargo yaml 0.3.0 ffi/YamlErrorType#::YAML_READER_ERRORrust-analyzer cargo yaml 0.3.0 ffi/YamlErrorType#YAML_READER_ERROR# => "Cannot read or decode the input stream", |
| 56 | YamlErrorTyperust-analyzer cargo yaml 0.3.0 ffi/YamlErrorType#::YAML_SCANNER_ERRORrust-analyzer cargo yaml 0.3.0 ffi/YamlErrorType#YAML_SCANNER_ERROR# => "Cannot scan the input stream", |
| 57 | YamlErrorTyperust-analyzer cargo yaml 0.3.0 ffi/YamlErrorType#::YAML_PARSER_ERRORrust-analyzer cargo yaml 0.3.0 ffi/YamlErrorType#YAML_PARSER_ERROR# => "Cannot parse the input stream", |
| 58 | YamlErrorTyperust-analyzer cargo yaml 0.3.0 ffi/YamlErrorType#::YAML_COMPOSER_ERRORrust-analyzer cargo yaml 0.3.0 ffi/YamlErrorType#YAML_COMPOSER_ERROR# => "Cannot compose a YAML document", |
| 59 | YamlErrorTyperust-analyzer cargo yaml 0.3.0 ffi/YamlErrorType#::YAML_WRITER_ERRORrust-analyzer cargo yaml 0.3.0 ffi/YamlErrorType#YAML_WRITER_ERROR# => "Cannot write to the output stream", |
| 60 | YamlErrorTyperust-analyzer cargo yaml 0.3.0 ffi/YamlErrorType#::YAML_EMITTER_ERRORrust-analyzer cargo yaml 0.3.0 ffi/YamlErrorType#YAML_EMITTER_ERROR# => "Cannot emit a YAML stream", |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | fn causerust-analyzer cargo yaml 0.3.0 error/impl#[YamlError][Error]cause().(&self) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<&Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error#> { |
| 65 | match self.io_errorrust-analyzer cargo yaml 0.3.0 error/YamlError#io_error. { |
| 66 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# => Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 67 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(ref e) => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(e as &Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error#) |
| 68 | } |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | impl YamlErrorrust-analyzer cargo yaml 0.3.0 error/YamlError# { |
| 73 | pub fn newrust-analyzer cargo yaml 0.3.0 error/impl#[YamlError]new().(kind: YamlErrorTyperust-analyzer cargo yaml 0.3.0 ffi/YamlErrorType#, problem: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>) -> YamlErrorrust-analyzer cargo yaml 0.3.0 error/YamlError# { |
| 74 | YamlErrorrust-analyzer cargo yaml 0.3.0 error/YamlError# { |
| 75 | kindrust-analyzer cargo yaml 0.3.0 error/YamlError#kind.: kind, |
| 76 | problemrust-analyzer cargo yaml 0.3.0 error/YamlError#problem.: problem, |
| 77 | io_errorrust-analyzer cargo yaml 0.3.0 error/YamlError#io_error.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 78 | contextrust-analyzer cargo yaml 0.3.0 error/YamlError#context.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# |
| 79 | } |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | 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 YamlErrorrust-analyzer cargo yaml 0.3.0 error/YamlError# { |
| 84 | fn fmtrust-analyzer cargo yaml 0.3.0 error/impl#[YamlError][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#) -> fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Result# { |
| 85 | match self.problemrust-analyzer cargo yaml 0.3.0 error/YamlError#problem. { |
| 86 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# => return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()), |
| 87 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(ref s) => s.fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][Display]fmt().(f) |
| 88 | } |
| 89 | } |
| 90 | } |