Debian Codegraph @

src/value.rs

raw symbols SCIP
1 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::borrowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/::Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#;
2 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/::{Intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/Into#, TryFromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/TryFrom#};
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/::{selfrust-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#, Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display#};
4 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/::Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#;
5 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/::{selfrust-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#};
6 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/::*;
7
8 #[cfg(feature = "serde")]
9 use serderust-analyzer cargo serde 1.0.228 crate/::{
10 derust-analyzer cargo serde_core 1.0.228 de/::{selfrust-analyzer cargo serde_core 1.0.228 de/, MapAccessrust-analyzer cargo serde_core 1.0.228 de/MapAccess#, SeqAccessrust-analyzer cargo serde_core 1.0.228 de/SeqAccess#, Visitorrust-analyzer cargo serde_core 1.0.228 de/Visitor#},
11 serrust-analyzer cargo serde_core 1.0.228 ser/::SerializeMaprust-analyzer cargo serde_core 1.0.228 ser/SerializeMap#,
12 Deserializerust-analyzer cargo serde_core 1.0.228 de/Deserialize#, Deserializerrust-analyzer cargo serde_core 1.0.228 de/Deserializer#, Serializerust-analyzer cargo serde_core 1.0.228 ser/Serialize#, Serializerrust-analyzer cargo serde_core 1.0.228 ser/Serializer#,
13 };
14
15 use craterust-analyzer cargo linux-audit-parser 0.2.8 crate/::*;
16
17 /// Quotes types in [`Value`] strings
18 #[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:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:, 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:)]
19 pub enum Quoterust-analyzer cargo linux-audit-parser 0.2.8 value/Quote# {
20 Nonerust-analyzer cargo linux-audit-parser 0.2.8 value/Quote#None#,
21 Singlerust-analyzer cargo linux-audit-parser 0.2.8 value/Quote#Single#,
22 Doublerust-analyzer cargo linux-audit-parser 0.2.8 value/Quote#Double#,
23 Bracesrust-analyzer cargo linux-audit-parser 0.2.8 value/Quote#Braces#,
24 }
25
26 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(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:)]
27 /// [`Value`]s parsed as hexadecimal, decimal, or octal numbers
28 pub enum Numberrust-analyzer cargo linux-audit-parser 0.2.8 value/Number# {
29 Hexrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#Hex#(u64),
30 Decrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#Dec#(i64),
31 Octrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#Oct#(u64),
32 }
33
34 impl Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug# for Numberrust-analyzer cargo linux-audit-parser 0.2.8 value/Number# {
35 fn fmtrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[Number][Debug]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# {
36 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "Num:<{self}>")
37 }
38 }
39
40 impl Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display# for Numberrust-analyzer cargo linux-audit-parser 0.2.8 value/Number# {
41 fn fmtrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[Number][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# {
42 match self {
43 Numberrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#::Hexrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#Hex#(n) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "0x{n:x}"),
44 Numberrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#::Octrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#Oct#(n) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "0o{n:o}"),
45 Numberrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#::Decrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#Dec#(n) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "{n}"),
46 }
47 }
48 }
49
50 impl FromStrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/traits/FromStr# for Numberrust-analyzer cargo linux-audit-parser 0.2.8 value/Number# {
51 type Errrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[Number][FromStr]Err# = stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::numrust-analyzer cargo std https://github.com/rust-lang/rust/library/std num/::ParseIntErrorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/error/ParseIntError#;
52 fn from_strrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[Number][FromStr]from_str().(s: &str) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[Number][FromStr], Selfrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[Number][FromStr]::Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/traits/FromStr#Err#> {
53 if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(s) = s.strip_prefixrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]strip_prefix().("0x") {
54 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Numberrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#::Hexrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#Hex#(u64::from_str_radixrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u64]from_str_radix().(s, 16)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().))
55 } else if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(s) = s.strip_prefixrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]strip_prefix().("0o") {
56 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Numberrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#::Octrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#Oct#(u64::from_str_radixrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u64]from_str_radix().(s, 8)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().))
57 } else {
58 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Numberrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#::Decrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#Dec#(i64::from_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[i64][FromStr]from_str().(s)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().))
59 }
60 }
61 }
62
63 #[cfg(feature = "serde")]
64 impl Serializerust-analyzer cargo serde_core 1.0.228 ser/Serialize# for Numberrust-analyzer cargo linux-audit-parser 0.2.8 value/Number# {
65 #[inline(always)]
66 fn serializerust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[Number][Serialize]serialize().<S: Serializerrust-analyzer cargo serde_core 1.0.228 ser/Serializer#>(&self, s: S) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<S::Okrust-analyzer cargo serde_core 1.0.228 ser/Serializer#Ok#, S::Errorrust-analyzer cargo serde_core 1.0.228 ser/Serializer#Error#> {
67 match self {
68 Numberrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#::Decrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#Dec#(n) => s.serialize_i64rust-analyzer cargo serde_core 1.0.228 ser/Serializer#serialize_i64().(*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().n),
69 _ => s.collect_strrust-analyzer cargo serde_core 1.0.228 ser/Serializer#collect_str().(&self),
70 }
71 }
72 }
73
74 #[cfg(feature = "serde")]
75 impl<'de> Deserializerust-analyzer cargo serde_core 1.0.228 de/Deserialize#<'de> for Numberrust-analyzer cargo linux-audit-parser 0.2.8 value/Number# {
76 fn deserializerust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[Number][`Deserialize<'de>`]deserialize().<D: Deserializerrust-analyzer cargo serde_core 1.0.228 de/Deserializer#<'de>>(d: D) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[Number][`Deserialize<'de>`], D::Errorrust-analyzer cargo serde_core 1.0.228 de/Deserializer#Error#> {
77 d.deserialize_anyrust-analyzer cargo serde_core 1.0.228 de/Deserializer#deserialize_any().(NumberVisitorrust-analyzer cargo linux-audit-parser 0.2.8 value/NumberVisitor#)
78 }
79 }
80
81 #[cfg(feature = "serde")]
82 struct NumberVisitorrust-analyzer cargo linux-audit-parser 0.2.8 value/NumberVisitor#;
83
84 #[cfg(feature = "serde")]
85 impl Visitorrust-analyzer cargo serde_core 1.0.228 de/Visitor#<'_> for NumberVisitorrust-analyzer cargo linux-audit-parser 0.2.8 value/NumberVisitor# {
86 type Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[NumberVisitor][`Visitor<'_>`]Value# = Numberrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#;
87
88 fn expectingrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[NumberVisitor][`Visitor<'_>`]expecting().(&self, formatter: &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# {
89 formatter.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().("a string or an integer")
90 }
91
92 fn visit_i64rust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[NumberVisitor][`Visitor<'_>`]visit_i64().<E: derust-analyzer cargo serde_core 1.0.228 de/::Errorrust-analyzer cargo serde_core 1.0.228 de/Error#>(self, value: i64) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[NumberVisitor][`Visitor<'_>`]::Valuerust-analyzer cargo serde_core 1.0.228 de/Visitor#Value#, E> {
93 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Numberrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#::Decrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#Dec#(value))
94 }
95
96 fn visit_u64rust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[NumberVisitor][`Visitor<'_>`]visit_u64().<E: derust-analyzer cargo serde_core 1.0.228 de/::Errorrust-analyzer cargo serde_core 1.0.228 de/Error#>(self, value: u64) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[NumberVisitor][`Visitor<'_>`]::Valuerust-analyzer cargo serde_core 1.0.228 de/Visitor#Value#, E> {
97 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Numberrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#::Decrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#Dec#(value as _))
98 }
99
100 fn visit_strrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[NumberVisitor][`Visitor<'_>`]visit_str().<E: derust-analyzer cargo serde_core 1.0.228 de/::Errorrust-analyzer cargo serde_core 1.0.228 de/Error#>(self, value: &str) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[NumberVisitor][`Visitor<'_>`]::Valuerust-analyzer cargo serde_core 1.0.228 de/Visitor#Value#, E> {
101 Numberrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#::from_strrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[Number][FromStr]from_str().(value).map_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map_err().(E::customrust-analyzer cargo serde_core 1.0.228 de/Error#custom().)
102 }
103 }
104
105 /// Representation of the value part of key/value pairs in [`Body`]
106 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(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:, Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default:)]
107 pub enum Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#<'a> {
108 /// Empty value.
109 #[defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/default:]
110 Emptyrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Empty#,
111 /// A byte string.
112 Strrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Str#(&'a [u8], Quoterust-analyzer cargo linux-audit-parser 0.2.8 value/Quote#),
113 /// Parsed number.
114 Numberrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Number#(Numberrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#),
115 /// A list of byte strings.
116 Listrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#List#(Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#<'a>>),
117 /// A byte string that is not stored within the [`Body`]. Used for
118 /// decoded hex-strings.
119 Ownedrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Owned#(Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<u8>),
120 /// An internal key/value map. Used when [`Parser::split_msg`] is set.
121 Maprust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Map#(Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<(Keyrust-analyzer cargo linux-audit-parser 0.2.8 key/Key#, Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#<'a>)>),
122 /// Non-contiguous byte string. Not produced by the parser.
123 Segmentsrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Segments#(Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<&'a [u8]>),
124 StringifiedListrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#StringifiedList#(Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#<'a>>),
125 /// Elements removed from ARGV lists. Not produced by the parser.
126 Skippedrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Skipped#((usize, usize)),
127 /// A literal string. Not produced by the parser.
128 Literalrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Literal#(&'static str),
129 }
130
131 impl Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#<'_> {
132 pub fn str_lenrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[`Value<'_>`]str_len().(&self) -> usize {
133 match self {
134 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Strrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Str#(r, _) => r.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().(),
135 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Segmentsrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Segments#(vr) => vr.iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().().maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|r| r.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().()).sumrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#sum().(),
136 _ => 0,
137 }
138 }
139 }
140
141 impl TryFromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/TryFrom#<Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#<'_>> for Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<u8> {
142 type Errorrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[`Vec<u8>`][`TryFrom<Value<'_>>`]Error# = &'static str;
143 fn try_fromrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[`Vec<u8>`][`TryFrom<Value<'_>>`]try_from().(v: Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[`Vec<u8>`][`TryFrom<Value<'_>>`], Selfrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[`Vec<u8>`][`TryFrom<Value<'_>>`]::Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/TryFrom#Error#> {
144 match v {
145 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Strrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Str#(r, Quoterust-analyzer cargo linux-audit-parser 0.2.8 value/Quote#::Bracesrust-analyzer cargo linux-audit-parser 0.2.8 value/Quote#Braces#) => {
146 let mut s = Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::with_capacityrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]with_capacity().(r.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().2);
147 s.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(b'{');
148 s.extendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Extend<T>`]extend().(Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::fromrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`][`From<&[T]>`]from().(r));
149 s.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(b'}');
150 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(s)
151 }
152 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Strrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Str#(r, _) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::fromrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`][`From<&[T]>`]from().(r)),
153 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Emptyrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Empty# => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#("".intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()),
154 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Segmentsrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Segments#(ranges) => {
155 let l = ranges.iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().().maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|r| r.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().()).sumrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#sum().();
156 let mut sb = Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::with_capacityrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]with_capacity().(l);
157 for r in ranges {
158 sb.extendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Extend<T>`]extend().(Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::fromrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`][`From<&[T]>`]from().(r));
159 }
160 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(sb)
161 }
162 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Numberrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Number#(_) => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#("Won't convert number to string"),
163 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Listrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#List#(_) | Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::StringifiedListrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#StringifiedList#(_) => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#("Can't convert list to scalar"),
164 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Maprust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Map#(_) => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#("Can't convert map to scalar"),
165 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Skippedrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Skipped#(_) => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#("Can't convert skipped to scalar"),
166 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Literalrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Literal#(s) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(s.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().().intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()),
167 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Ownedrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Owned#(v) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(v),
168 }
169 }
170 }
171
172 impl TryFromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/TryFrom#<Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#<'_>> for Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<u8>> {
173 type Errorrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[`Vec<Vec<u8>>`][`TryFrom<Value<'_>>`]Error# = &'static str;
174 fn try_fromrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[`Vec<Vec<u8>>`][`TryFrom<Value<'_>>`]try_from().(value: Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[`Vec<Vec<u8>>`][`TryFrom<Value<'_>>`], Selfrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[`Vec<Vec<u8>>`][`TryFrom<Value<'_>>`]::Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/TryFrom#Error#> {
175 match value {
176 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Listrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#List#(values) | Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::StringifiedListrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#StringifiedList#(values) => {
177 let mut rv = Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::with_capacityrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]with_capacity().(values.lenrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]len().());
178 for v in values {
179 let s = Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::try_fromrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[`Vec<u8>`][`TryFrom<Value<'_>>`]try_from().(v)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
180 rv.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(s);
181 }
182 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(rv)
183 }
184 _ => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#("not a list"),
185 }
186 }
187 }
188
189 impl Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug# for Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#<'_> {
190 fn fmtrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[`Value<'_>`][Debug]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# {
191 match self {
192 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Strrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Str#(r, _q) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "Str:<{}>", Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::from_utf8_lossyrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]from_utf8_lossy().(r)),
193 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Emptyrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Empty# => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "Empty"),
194 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Segmentsrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Segments#(segs) => {
195 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "Segments<")?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
196 for (n, r) in segs.iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().().enumeraterust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#enumerate().() {
197 if n rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().0 {
198 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, ", ")?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
199 }
200 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "{}", Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::from_utf8_lossyrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]from_utf8_lossy().(r))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
201 }
202 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, ">")
203 }
204 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Listrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#List#(vs) => {
205 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "List:<")?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
206 for (n, v) in vs.iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().().enumeraterust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#enumerate().() {
207 if n rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().0 {
208 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, ", ")?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
209 }
210 match v {
211 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Strrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Str#(r, _) => {
212 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "{}", Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::from_utf8_lossyrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]from_utf8_lossy().(r))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
213 }
214 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Segmentsrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Segments#(rs) => {
215 for r in rs {
216 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "{}", Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::from_utf8_lossyrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]from_utf8_lossy().(r))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
217 }
218 }
219 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Numberrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Number#(n) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "{n:?}")?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().,
220 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Skippedrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Skipped#((elems, bytes)) => {
221 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "Skip<elems{elems} bytes={bytes}>")?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
222 }
223 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Emptyrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Empty# => panicrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/panic!!("list can't contain empty value"),
224 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Listrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#List#(_) | Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::StringifiedListrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#StringifiedList#(_) => {
225 panicrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/panic!!("list can't contain list")
226 }
227 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Maprust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Map#(_) => panicrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/panic!!("list can't contain map"),
228 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Literalrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Literal#(v) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "{v:?}")?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().,
229 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Ownedrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Owned#(v) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "{}", Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::from_utf8_lossyrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]from_utf8_lossy().(v))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().,
230 }
231 }
232 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, ">")
233 }
234 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::StringifiedListrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#StringifiedList#(vs) => {
235 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "StringifiedList:<")?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
236 for (n, v) in vs.iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().().enumeraterust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#enumerate().() {
237 if n rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().0 {
238 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, " ")?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
239 }
240 match v {
241 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Strrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Str#(r, _) => {
242 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "{}", Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::from_utf8_lossyrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]from_utf8_lossy().(r))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
243 }
244 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Segmentsrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Segments#(rs) => {
245 for r in rs {
246 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "{}", Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::from_utf8_lossyrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]from_utf8_lossy().(r))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
247 }
248 }
249 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Numberrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Number#(n) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "{n:?}")?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().,
250 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Skippedrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Skipped#((elems, bytes)) => {
251 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "Skip<elems={elems} bytes={bytes}>")?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
252 }
253 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Emptyrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Empty# => panicrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/panic!!("list can't contain empty value"),
254 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Listrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#List#(_) | Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::StringifiedListrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#StringifiedList#(_) => {
255 panicrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/panic!!("list can't contain list")
256 }
257 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Maprust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Map#(_) => panicrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/panic!!("List can't contain mapr"),
258 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Literalrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Literal#(v) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "{v}")?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().,
259 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Ownedrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Owned#(v) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "{}", Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::from_utf8_lossyrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]from_utf8_lossy().(v))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().,
260 }
261 }
262 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, ">")
263 }
264 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Maprust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Map#(vs) => {
265 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "Map:<")?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
266 for (n, (k, v)) in vs.iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().().enumeraterust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#enumerate().() {
267 if n rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().0 {
268 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, " ")?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
269 }
270 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "{k:?}={v:?}")?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
271 }
272 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, ">")
273 }
274 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Numberrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Number#(n) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "{n:?}"),
275 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Skippedrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Skipped#((elems, bytes)) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "Skip<elems={elems} bytes={bytes}>"),
276 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Literalrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Literal#(s) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "{s:?}"),
277 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Ownedrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Owned#(v) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "{}", Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::from_utf8_lossyrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]from_utf8_lossy().(v)),
278 }
279 }
280 }
281
282 #[cfg(feature = "serde")]
283 impl Serializerust-analyzer cargo serde_core 1.0.228 ser/Serialize# for Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#<'_> {
284 #[inline(always)]
285 fn serializerust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[`Value<'_>`][Serialize]serialize().<S: Serializerrust-analyzer cargo serde_core 1.0.228 ser/Serializer#>(&self, s: S) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<S::Okrust-analyzer cargo serde_core 1.0.228 ser/Serializer#Ok#, S::Errorrust-analyzer cargo serde_core 1.0.228 ser/Serializer#Error#> {
286 match self {
287 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Emptyrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Empty# => s.serialize_unitrust-analyzer cargo serde_core 1.0.228 ser/Serializer#serialize_unit().(),
288 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Strrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Str#(r, Quoterust-analyzer cargo linux-audit-parser 0.2.8 value/Quote#::Bracesrust-analyzer cargo linux-audit-parser 0.2.8 value/Quote#Braces#) => {
289 let mut buf = Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::with_capacityrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]with_capacity().(r.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().2);
290 buf.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(b'{');
291 buf.extendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Extend<&'a T>`]extend().(*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().r);
292 buf.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(b'}');
293 s.serialize_bytesrust-analyzer cargo serde_core 1.0.228 ser/Serializer#serialize_bytes().(&buf)
294 }
295 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Strrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Str#(r, _) => s.serialize_bytesrust-analyzer cargo serde_core 1.0.228 ser/Serializer#serialize_bytes().(r),
296 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Segmentsrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Segments#(segs) => {
297 let l = segs.iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().().maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|r| r.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().()).sumrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#sum().();
298 let mut buf = Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::with_capacityrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]with_capacity().(l);
299 for seg in segs {
300 buf.extendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Extend<&'a T>`]extend().(*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().seg);
301 }
302 s.serialize_bytesrust-analyzer cargo serde_core 1.0.228 ser/Serializer#serialize_bytes().(&buf)
303 }
304 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Listrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#List#(vs) => s.collect_seqrust-analyzer cargo serde_core 1.0.228 ser/Serializer#collect_seq().(vs.iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().()),
305 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::StringifiedListrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#StringifiedList#(vs) => {
306 let mut buf: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<u8> = Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::with_capacityrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]with_capacity().(vs.lenrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]len().());
307 let mut first = true;
308 for v in vs {
309 if first {
310 first = false;
311 } else {
312 buf.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(b' ');
313 }
314 if let Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Skippedrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Skipped#((args, bytes)) = v {
315 buf.extendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Extend<T>`]extend().(formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("<<< Skipped: args={args}, bytes={bytes} >>>").bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]bytes().());
316 } else {
317 buf.extendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Extend<T>`]extend().(v.clonerust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[`Value<'a>`][Clone]clone().().try_intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`TryInto<U>`]try_into().().unwrap_or_elserust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap_or_else().(|_| vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![b'x']));
318 }
319 }
320 s.serialize_bytesrust-analyzer cargo serde_core 1.0.228 ser/Serializer#serialize_bytes().(&buf)
321 }
322 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Numberrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Number#(n) => n.serializerust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[Number][Serialize]serialize().(s),
323 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Maprust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Map#(vs) => s.collect_maprust-analyzer cargo serde_core 1.0.228 ser/Serializer#collect_map().(vs.iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().().clonedrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#cloned().()),
324 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Skippedrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Skipped#((args, bytes)) => {
325 let mut map = s.serialize_maprust-analyzer cargo serde_core 1.0.228 ser/Serializer#serialize_map().(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(2))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
326 map.serialize_entryrust-analyzer cargo serde_core 1.0.228 ser/SerializeMap#serialize_entry().("skipped_args", args)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
327 map.serialize_entryrust-analyzer cargo serde_core 1.0.228 ser/SerializeMap#serialize_entry().("skipped_bytes", bytes)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
328 map.endrust-analyzer cargo serde_core 1.0.228 ser/SerializeMap#end().()
329 }
330 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Literalrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Literal#(v) => s.collect_strrust-analyzer cargo serde_core 1.0.228 ser/Serializer#collect_str().(v),
331 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Ownedrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Owned#(v) => s.serialize_bytesrust-analyzer cargo serde_core 1.0.228 ser/Serializer#serialize_bytes().(v),
332 }
333 }
334 }
335
336 #[cfg(feature = "serde")]
337 struct ValueVisitorrust-analyzer cargo linux-audit-parser 0.2.8 value/ValueVisitor#;
338
339 #[cfg(feature = "serde")]
340 impl<'de> Visitorrust-analyzer cargo serde_core 1.0.228 de/Visitor#<'de> for ValueVisitorrust-analyzer cargo linux-audit-parser 0.2.8 value/ValueVisitor# {
341 type Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[ValueVisitor][`Visitor<'de>`]Value# = Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#<'de>;
342
343 fn expectingrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[ValueVisitor][`Visitor<'de>`]expecting().(&self, formatter: &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# {
344 formatter.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().("a string, integer, sequence, map, or null value")
345 }
346
347 fn visit_nonerust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[ValueVisitor][`Visitor<'de>`]visit_none().<E: derust-analyzer cargo serde_core 1.0.228 de/::Errorrust-analyzer cargo serde_core 1.0.228 de/Error#>(self) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[ValueVisitor][`Visitor<'de>`]::Valuerust-analyzer cargo serde_core 1.0.228 de/Visitor#Value#, E> {
348 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Emptyrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Empty#)
349 }
350
351 fn visit_unitrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[ValueVisitor][`Visitor<'de>`]visit_unit().<E: derust-analyzer cargo serde_core 1.0.228 de/::Errorrust-analyzer cargo serde_core 1.0.228 de/Error#>(self) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[ValueVisitor][`Visitor<'de>`]::Valuerust-analyzer cargo serde_core 1.0.228 de/Visitor#Value#, E> {
352 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Emptyrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Empty#)
353 }
354
355 fn visit_i64rust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[ValueVisitor][`Visitor<'de>`]visit_i64().<E: derust-analyzer cargo serde_core 1.0.228 de/::Errorrust-analyzer cargo serde_core 1.0.228 de/Error#>(self, value: i64) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[ValueVisitor][`Visitor<'de>`]::Valuerust-analyzer cargo serde_core 1.0.228 de/Visitor#Value#, E> {
356 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Numberrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Number#(Numberrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#::Decrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#Dec#(value)))
357 }
358
359 fn visit_u64rust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[ValueVisitor][`Visitor<'de>`]visit_u64().<E: derust-analyzer cargo serde_core 1.0.228 de/::Errorrust-analyzer cargo serde_core 1.0.228 de/Error#>(self, value: u64) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[ValueVisitor][`Visitor<'de>`]::Valuerust-analyzer cargo serde_core 1.0.228 de/Visitor#Value#, E> {
360 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Numberrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Number#(Numberrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#::Decrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#Dec#(value as _)))
361 }
362
363 fn visit_strrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[ValueVisitor][`Visitor<'de>`]visit_str().<E: derust-analyzer cargo serde_core 1.0.228 de/::Errorrust-analyzer cargo serde_core 1.0.228 de/Error#>(self, value: &str) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[ValueVisitor][`Visitor<'de>`]::Valuerust-analyzer cargo serde_core 1.0.228 de/Visitor#Value#, E> {
364 if let Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(n) = Numberrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#::from_strrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[Number][FromStr]from_str().(value) {
365 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Numberrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Number#(n))
366 } else {
367 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::fromrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[`Value<'_>`][`From<String>`]from().(value.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()))
368 }
369 }
370
371 fn visit_bytesrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[ValueVisitor][`Visitor<'de>`]visit_bytes().<E: derust-analyzer cargo serde_core 1.0.228 de/::Errorrust-analyzer cargo serde_core 1.0.228 de/Error#>(self, value: &[u8]) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[ValueVisitor][`Visitor<'de>`]::Valuerust-analyzer cargo serde_core 1.0.228 de/Visitor#Value#, E> {
372 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::fromrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[`Value<'_>`][`From<Vec<u8>>`]from().(value.to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().()))
373 }
374
375 fn visit_seqrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[ValueVisitor][`Visitor<'de>`]visit_seq().<A: SeqAccessrust-analyzer cargo serde_core 1.0.228 de/SeqAccess#<'de>>(self, mut seq: A) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[ValueVisitor][`Visitor<'de>`]::Valuerust-analyzer cargo serde_core 1.0.228 de/Visitor#Value#, A::Errorrust-analyzer cargo serde_core 1.0.228 de/SeqAccess#Error#> {
376 let mut v = vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![];
377 while let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(elem) = seq.next_elementrust-analyzer cargo serde_core 1.0.228 de/SeqAccess#next_element().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). {
378 v.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(elem);
379 }
380 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Listrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#List#(v))
381 }
382
383 fn visit_maprust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[ValueVisitor][`Visitor<'de>`]visit_map().<A: MapAccessrust-analyzer cargo serde_core 1.0.228 de/MapAccess#<'de>>(self, mut map: A) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[ValueVisitor][`Visitor<'de>`]::Valuerust-analyzer cargo serde_core 1.0.228 de/Visitor#Value#, A::Errorrust-analyzer cargo serde_core 1.0.228 de/MapAccess#Error#> {
384 let mut kv = vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![];
385 while let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#((k, v)) = map.next_entryrust-analyzer cargo serde_core 1.0.228 de/MapAccess#next_entry().::<Keyrust-analyzer cargo linux-audit-parser 0.2.8 key/Key#, Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#>()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). {
386 kv.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().((k, v));
387 }
388 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Maprust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Map#(kv))
389 }
390 }
391
392 #[cfg(feature = "serde")]
393 impl<'de> Deserializerust-analyzer cargo serde_core 1.0.228 de/Deserialize#<'de> for Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#<'de> {
394 #[inline(always)]
395 fn deserializerust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[`Value<'de>`][`Deserialize<'de>`]deserialize().<D: Deserializerrust-analyzer cargo serde_core 1.0.228 de/Deserializer#<'de>>(d: D) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[`Value<'de>`][`Deserialize<'de>`], D::Errorrust-analyzer cargo serde_core 1.0.228 de/Deserializer#Error#> {
396 d.deserialize_anyrust-analyzer cargo serde_core 1.0.228 de/Deserializer#deserialize_any().(ValueVisitorrust-analyzer cargo linux-audit-parser 0.2.8 value/ValueVisitor#)
397 }
398 }
399
400 impl PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#<str> for Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#<'_> {
401 fn eqrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[`Value<'_>`][`PartialEq<str>`]eq().(&self, other: &str) -> bool {
402 self rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]eq().other.as_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]as_bytes().()
403 }
404 }
405
406 impl PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#<[u8]> for Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#<'_> {
407 fn eqrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[`Value<'_>`][`PartialEq<[u8]>`]eq().(&self, other: &[u8]) -> bool {
408 match self {
409 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Emptyrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Empty# => other.is_emptyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]is_empty().(),
410 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Strrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Str#(r, _) => r rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]eq().&other,
411 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Segmentsrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Segments#(segs) => {
412 let l = segs.iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().().maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|s| s.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().()).sumrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#sum().();
413 let mut buf: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<u8> = Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::with_capacityrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]with_capacity().(l);
414 for s in segs {
415 buf.extendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Extend<&'a T>`]extend().(*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().s);
416 }
417 buf rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/partial_eq/impl#[`Vec<T, A>`][`PartialEq<&[U]>`]eq().==rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/partial_eq/impl#[`Vec<T, A>`][`PartialEq<&[U]>`]eq(). rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/partial_eq/impl#[`Vec<T, A>`][`PartialEq<&[U]>`]eq().other
418 }
419 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Literalrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Literal#(s) => s.as_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]as_bytes().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]eq().other,
420 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Ownedrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Owned#(v) => v rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]eq().other,
421 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Listrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#List#(_)
422 | Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::StringifiedListrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#StringifiedList#(_)
423 | Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Maprust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Map#(_)
424 | Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Skippedrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Skipped#(_)
425 | Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Numberrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Number#(_) => false,
426 }
427 }
428 }
429
430 impl<'a> Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'a, [u8]>>> for Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#<'a> {
431 fn fromrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[`Value<'a>`][`From<Option<Cow<'a, [u8]>>>`]from().(value: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'a, [u8]>>) -> Selfrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[`Value<'a>`][`From<Option<Cow<'a, [u8]>>>`] {
432 match value {
433 Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#::Borrowedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#Borrowed#(v)) => Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Strrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Str#(v, Quoterust-analyzer cargo linux-audit-parser 0.2.8 value/Quote#::Doublerust-analyzer cargo linux-audit-parser 0.2.8 value/Quote#Double#),
434 Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#::Ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#Owned#(v)) => Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Ownedrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Owned#(v),
435 Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# => Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Emptyrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Empty#,
436 }
437 }
438 }
439
440 impl<'a> Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<&'a [u8]> for Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#<'a> {
441 fn fromrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[`Value<'a>`][`From<&'a [u8]>`]from().(value: &'a [u8]) -> Selfrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[`Value<'a>`][`From<&'a [u8]>`] {
442 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Strrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Str#(value, Quoterust-analyzer cargo linux-audit-parser 0.2.8 value/Quote#::Nonerust-analyzer cargo linux-audit-parser 0.2.8 value/Quote#None#)
443 }
444 }
445
446 impl<'a> Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<&'a str> for Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#<'a> {
447 fn fromrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[`Value<'a>`][`From<&'a str>`]from().(value: &'a str) -> Selfrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[`Value<'a>`][`From<&'a str>`] {
448 Selfrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[`Value<'a>`][`From<&'a str>`]::fromrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[`Value<'a>`][`From<&'a [u8]>`]from().(value.as_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]as_bytes().())
449 }
450 }
451
452 impl Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<u8>> for Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#<'_> {
453 fn fromrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[`Value<'_>`][`From<Vec<u8>>`]from().(value: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<u8>) -> Selfrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[`Value<'_>`][`From<Vec<u8>>`] {
454 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Ownedrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Owned#(value)
455 }
456 }
457
458 impl Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#> for Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#<'_> {
459 fn fromrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[`Value<'_>`][`From<String>`]from().(value: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#) -> Selfrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[`Value<'_>`][`From<String>`] {
460 Selfrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[`Value<'_>`][`From<String>`]::fromrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[`Value<'_>`][`From<Vec<u8>>`]from().(Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::fromrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[`Vec<u8>`][`From<String>`]from().(value))
461 }
462 }
463
464 impl Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<i64> for Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#<'_> {
465 fn fromrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[`Value<'_>`][`From<i64>`]from().(value: i64) -> Selfrust-analyzer cargo linux-audit-parser 0.2.8 value/impl#[`Value<'_>`][`From<i64>`] {
466 Valuerust-analyzer cargo linux-audit-parser 0.2.8 value/Value#::Numberrust-analyzer cargo linux-audit-parser 0.2.8 value/Value#Number#(Numberrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#::Decrust-analyzer cargo linux-audit-parser 0.2.8 value/Number#Dec#(value))
467 }
468 }