Debian Codegraph @

src/error.rs

raw symbols SCIP
1 use corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::{errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/, fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/};
2
3 /// Media-type format error.
4 #[non_exhaustive]
5 #[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:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Hashrust-analyzer cargo core https://github.com/rust-lang/rust/library/core hash/macros/Hash:)]
6 pub enum MediaTypeErrorrust-analyzer cargo mediatype 0.23.0 error/MediaTypeError# {
7 /// The top-level type name is not valid.
8 InvalidTypeNamerust-analyzer cargo mediatype 0.23.0 error/MediaTypeError#InvalidTypeName#,
9 /// The subtype name is not valid.
10 InvalidSubtypeNamerust-analyzer cargo mediatype 0.23.0 error/MediaTypeError#InvalidSubtypeName#,
11 /// The suffix name is not valid.
12 InvalidSuffixrust-analyzer cargo mediatype 0.23.0 error/MediaTypeError#InvalidSuffix#,
13 /// The parameter syntax is not valid.
14 InvalidParamsrust-analyzer cargo mediatype 0.23.0 error/MediaTypeError#InvalidParams#,
15 /// An invalid parameter name is detected.
16 InvalidParamNamerust-analyzer cargo mediatype 0.23.0 error/MediaTypeError#InvalidParamName#,
17 /// An invalid parameter value is detected.
18 InvalidParamValuerust-analyzer cargo mediatype 0.23.0 error/MediaTypeError#InvalidParamValue#,
19 }
20
21 impl fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display# for MediaTypeErrorrust-analyzer cargo mediatype 0.23.0 error/MediaTypeError# {
22 fn fmtrust-analyzer cargo mediatype 0.23.0 error/impl#[MediaTypeError][Display]fmt().(&self, f: &mut fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#<'_>) -> fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Result# {
23 let msg = match self {
24 Selfrust-analyzer cargo mediatype 0.23.0 error/impl#[MediaTypeError][Display]::InvalidTypeNamerust-analyzer cargo mediatype 0.23.0 error/MediaTypeError#InvalidTypeName# => "Invalid type name",
25 Selfrust-analyzer cargo mediatype 0.23.0 error/impl#[MediaTypeError][Display]::InvalidSubtypeNamerust-analyzer cargo mediatype 0.23.0 error/MediaTypeError#InvalidSubtypeName# => "Invalid subtype name",
26 Selfrust-analyzer cargo mediatype 0.23.0 error/impl#[MediaTypeError][Display]::InvalidSuffixrust-analyzer cargo mediatype 0.23.0 error/MediaTypeError#InvalidSuffix# => "Invalid suffix",
27 Selfrust-analyzer cargo mediatype 0.23.0 error/impl#[MediaTypeError][Display]::InvalidParamsrust-analyzer cargo mediatype 0.23.0 error/MediaTypeError#InvalidParams# => "Invalid params",
28 Selfrust-analyzer cargo mediatype 0.23.0 error/impl#[MediaTypeError][Display]::InvalidParamNamerust-analyzer cargo mediatype 0.23.0 error/MediaTypeError#InvalidParamName# => "Invalid param name",
29 Selfrust-analyzer cargo mediatype 0.23.0 error/impl#[MediaTypeError][Display]::InvalidParamValuerust-analyzer cargo mediatype 0.23.0 error/MediaTypeError#InvalidParamValue# => "Invalid param value",
30 };
31 f.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().(msg)
32 }
33 }
34
35 impl errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/::Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error# for MediaTypeErrorrust-analyzer cargo mediatype 0.23.0 error/MediaTypeError# {}