Debian Codegraph @

src/parser/content_line/mod.rs

raw symbols SCIP
1 mod content_line_partsrust-analyzer cargo rrule 0.14.0 parser/content_line/content_line_parts/;
2 mod date_content_linerust-analyzer cargo rrule 0.14.0 parser/content_line/date_content_line/;
3 mod parametersrust-analyzer cargo rrule 0.14.0 parser/content_line/parameters/;
4 mod rule_content_linerust-analyzer cargo rrule 0.14.0 parser/content_line/rule_content_line/;
5 mod start_date_content_linerust-analyzer cargo rrule 0.14.0 parser/content_line/start_date_content_line/;
6
7 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/::Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display#;
8 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/::FromStrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/traits/FromStr#;
9
10 use craterust-analyzer cargo rrule 0.14.0 crate/::RRulerust-analyzer cargo rrule 0.14.0 core/rrule/RRule#;
11 use craterust-analyzer cargo rrule 0.14.0 crate/::Tzrust-analyzer cargo rrule 0.14.0 core/timezone/Tz#;
12 use craterust-analyzer cargo rrule 0.14.0 crate/::Unvalidatedrust-analyzer cargo rrule 0.14.0 core/Unvalidated#;
13
14 pub(craterust-analyzer cargo rrule 0.14.0 crate/) use content_line_partsrust-analyzer cargo rrule 0.14.0 parser/content_line/content_line_parts/::ContentLineCapturesrust-analyzer cargo rrule 0.14.0 parser/content_line/content_line_parts/ContentLineCaptures#;
15 pub(craterust-analyzer cargo rrule 0.14.0 crate/) use start_date_content_linerust-analyzer cargo rrule 0.14.0 parser/content_line/start_date_content_line/::StartDateContentLinerust-analyzer cargo rrule 0.14.0 parser/content_line/start_date_content_line/StartDateContentLine#;
16
17 use superrust-analyzer cargo rrule 0.14.0 parser/::ParseErrorrust-analyzer cargo rrule 0.14.0 parser/error/ParseError#;
18
19 #[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:)]
20 pub(craterust-analyzer cargo rrule 0.14.0 crate/) enum ContentLinerust-analyzer cargo rrule 0.14.0 parser/content_line/ContentLine# {
21 RRulerust-analyzer cargo rrule 0.14.0 parser/content_line/ContentLine#RRule#(RRulerust-analyzer cargo rrule 0.14.0 core/rrule/RRule#<Unvalidatedrust-analyzer cargo rrule 0.14.0 core/Unvalidated#>),
22 ExRulerust-analyzer cargo rrule 0.14.0 parser/content_line/ContentLine#ExRule#(RRulerust-analyzer cargo rrule 0.14.0 core/rrule/RRule#<Unvalidatedrust-analyzer cargo rrule 0.14.0 core/Unvalidated#>),
23 ExDaterust-analyzer cargo rrule 0.14.0 parser/content_line/ContentLine#ExDate#(Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<chronorust-analyzer cargo chrono 0.4.40 crate/::DateTimerust-analyzer cargo chrono 0.4.40 datetime/DateTime#<Tzrust-analyzer cargo rrule 0.14.0 core/timezone/Tz#>>),
24 RDaterust-analyzer cargo rrule 0.14.0 parser/content_line/ContentLine#RDate#(Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<chronorust-analyzer cargo chrono 0.4.40 crate/::DateTimerust-analyzer cargo chrono 0.4.40 datetime/DateTime#<Tzrust-analyzer cargo rrule 0.14.0 core/timezone/Tz#>>),
25 }
26
27 #[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:)]
28 pub(craterust-analyzer cargo rrule 0.14.0 crate/) enum PropertyNamerust-analyzer cargo rrule 0.14.0 parser/content_line/PropertyName# {
29 RRulerust-analyzer cargo rrule 0.14.0 parser/content_line/PropertyName#RRule#,
30 ExRulerust-analyzer cargo rrule 0.14.0 parser/content_line/PropertyName#ExRule#,
31 ExDaterust-analyzer cargo rrule 0.14.0 parser/content_line/PropertyName#ExDate#,
32 RDaterust-analyzer cargo rrule 0.14.0 parser/content_line/PropertyName#RDate#,
33 DtStartrust-analyzer cargo rrule 0.14.0 parser/content_line/PropertyName#DtStart#,
34 }
35
36 impl Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display# for PropertyNamerust-analyzer cargo rrule 0.14.0 parser/content_line/PropertyName# {
37 fn fmtrust-analyzer cargo rrule 0.14.0 parser/content_line/impl#[PropertyName][Display]fmt().(&self, f: &mut 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/::Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#<'_>) -> 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/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Result# {
38 match *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().self {
39 Selfrust-analyzer cargo rrule 0.14.0 parser/content_line/impl#[PropertyName][Display]::RRulerust-analyzer cargo rrule 0.14.0 parser/content_line/PropertyName#RRule# => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "RRULE"),
40 Selfrust-analyzer cargo rrule 0.14.0 parser/content_line/impl#[PropertyName][Display]::ExRulerust-analyzer cargo rrule 0.14.0 parser/content_line/PropertyName#ExRule# => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "EXRULE"),
41 Selfrust-analyzer cargo rrule 0.14.0 parser/content_line/impl#[PropertyName][Display]::ExDaterust-analyzer cargo rrule 0.14.0 parser/content_line/PropertyName#ExDate# => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "EXDATE"),
42 Selfrust-analyzer cargo rrule 0.14.0 parser/content_line/impl#[PropertyName][Display]::RDaterust-analyzer cargo rrule 0.14.0 parser/content_line/PropertyName#RDate# => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "RDATE"),
43 Selfrust-analyzer cargo rrule 0.14.0 parser/content_line/impl#[PropertyName][Display]::DtStartrust-analyzer cargo rrule 0.14.0 parser/content_line/PropertyName#DtStart# => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "DTSTART"),
44 }
45 }
46 }
47
48 impl FromStrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/traits/FromStr# for PropertyNamerust-analyzer cargo rrule 0.14.0 parser/content_line/PropertyName# {
49 type Errrust-analyzer cargo rrule 0.14.0 parser/content_line/impl#[PropertyName][FromStr]Err# = ParseErrorrust-analyzer cargo rrule 0.14.0 parser/error/ParseError#;
50
51 fn from_strrust-analyzer cargo rrule 0.14.0 parser/content_line/impl#[PropertyName][FromStr]from_str().(s: &str) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo rrule 0.14.0 parser/content_line/impl#[PropertyName][FromStr], Selfrust-analyzer cargo rrule 0.14.0 parser/content_line/impl#[PropertyName][FromStr]::Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/traits/FromStr#Err#> {
52 let name = match &s[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()..to_uppercaserust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str]to_uppercase().()[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`Index<I>`]index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`Index<I>`]index(). {
53 "RRULE" => Selfrust-analyzer cargo rrule 0.14.0 parser/content_line/impl#[PropertyName][FromStr]::RRulerust-analyzer cargo rrule 0.14.0 parser/content_line/PropertyName#RRule#,
54 "EXRULE" => Selfrust-analyzer cargo rrule 0.14.0 parser/content_line/impl#[PropertyName][FromStr]::ExRulerust-analyzer cargo rrule 0.14.0 parser/content_line/PropertyName#ExRule#,
55 "RDATE" => Selfrust-analyzer cargo rrule 0.14.0 parser/content_line/impl#[PropertyName][FromStr]::RDaterust-analyzer cargo rrule 0.14.0 parser/content_line/PropertyName#RDate#,
56 "EXDATE" => Selfrust-analyzer cargo rrule 0.14.0 parser/content_line/impl#[PropertyName][FromStr]::ExDaterust-analyzer cargo rrule 0.14.0 parser/content_line/PropertyName#ExDate#,
57 "DTSTART" => Selfrust-analyzer cargo rrule 0.14.0 parser/content_line/impl#[PropertyName][FromStr]::DtStartrust-analyzer cargo rrule 0.14.0 parser/content_line/PropertyName#DtStart#,
58 _ => return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(ParseErrorrust-analyzer cargo rrule 0.14.0 parser/error/ParseError#::UnrecognizedPropertyNamerust-analyzer cargo rrule 0.14.0 parser/error/ParseError#UnrecognizedPropertyName#(s.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().())),
59 };
60 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(name)
61 }
62 }