| 1 | #![doc = include_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_str!!("../README.md")] |
| 2 | #![cfg_attr(docsrs, feature(doc_auto_cfg))] |
| 3 | #![deny(unsafe_code)] |
| 4 | |
| 5 | #[cfg(feature = "serde")] |
| 6 | use serderust-analyzer cargo serde 1.0.229 crate/::{Deserializerust-analyzer cargo serde_core 1.0.229 de/Deserialize#, Deserializerrust-analyzer cargo serde_core 1.0.229 de/Deserializer#, Serializerust-analyzer cargo serde_core 1.0.229 ser/Serialize#, Serializerrust-analyzer cargo serde_core 1.0.229 ser/Serializer#}; |
| 7 | 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/::{Borrowrust-analyzer cargo core https://github.com/rust-lang/rust/library/core borrow/Borrow#, Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#}; |
| 8 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::cmprust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/::Orderingrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#; |
| 9 | 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/::{TryFromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/TryFrom#, TryIntorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/TryInto#}; |
| 10 | 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#; |
| 11 | 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/; |
| 12 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::hashrust-analyzer cargo std https://github.com/rust-lang/rust/library/std hash/::{Hashrust-analyzer cargo core https://github.com/rust-lang/rust/library/core hash/Hash#, Hasherrust-analyzer cargo core https://github.com/rust-lang/rust/library/core hash/Hasher#}; |
| 13 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::netrust-analyzer cargo std https://github.com/rust-lang/rust/library/std net/::{AddrParseErrorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/parser/AddrParseError#, Ipv6Addrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/ip_addr/Ipv6Addr#}; |
| 14 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::opsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/::Derefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref#; |
| 15 | 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/::{Charsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/iter/Chars#, FromStrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/traits/FromStr#}; |
| 16 | |
| 17 | /// A [RFC 3987](https://www.ietf.org/rfc/rfc3987.html) IRI reference. |
| 18 | /// |
| 19 | /// Instances of this type may be absolute or relative, |
| 20 | /// unlike [`Iri`]. |
| 21 | /// |
| 22 | /// ``` |
| 23 | /// use oxiri::{Iri, IriRef}; |
| 24 | /// |
| 25 | /// // Parse and validate base IRI |
| 26 | /// let base_iri = IriRef::parse("../bar/baz")?; |
| 27 | /// |
| 28 | /// // Validate and resolve relative IRI |
| 29 | /// let iri = base_iri.resolve("bat#foo")?; |
| 30 | /// assert_eq!(iri.into_inner(), "../bar/bat#foo"); |
| 31 | /// |
| 32 | /// // IriRef's *can* also be absolute. |
| 33 | /// assert!(IriRef::parse("http://foo.com/bar/baz").is_ok()); |
| 34 | /// |
| 35 | /// // It is possible to build an IriRef from an Iri object |
| 36 | /// IriRef::from(Iri::parse("http://foo.com/bar")?); |
| 37 | /// # Result::<(), oxiri::IriParseError>::Ok(()) |
| 38 | /// ``` |
| 39 | #[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:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:)] |
| 40 | pub struct IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<T> { |
| 41 | irirust-analyzer cargo oxiri 0.2.11 IriRef#iri.: T, |
| 42 | positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions.: IriElementsPositionsrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#, |
| 43 | } |
| 44 | |
| 45 | impl<T: Derefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref#<Targetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref#Target# = str>> IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<T> { |
| 46 | /// Parses and validates the IRI-reference following the grammar from [RFC 3987](https://www.ietf.org/rfc/rfc3987.html). |
| 47 | /// |
| 48 | /// This operation keeps internally the `iri` parameter and does not allocate. |
| 49 | /// |
| 50 | /// Use [`parse_unchecked`](Self::parse_unchecked) if you already know the IRI is valid to get faster processing. |
| 51 | /// |
| 52 | /// ``` |
| 53 | /// use oxiri::IriRef; |
| 54 | /// |
| 55 | /// IriRef::parse("//foo.com/bar/baz")?; |
| 56 | /// # Result::<(), oxiri::IriParseError>::Ok(()) |
| 57 | /// ``` |
| 58 | pub fn parserust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`]parse().(iri: T) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`], IriParseErrorrust-analyzer cargo oxiri 0.2.11 IriParseError#> { |
| 59 | let positions = IriParserrust-analyzer cargo oxiri 0.2.11 IriParser#::<_, false>::parserust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse().(&iri, Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, &mut VoidOutputBufferrust-analyzer cargo oxiri 0.2.11 VoidOutputBuffer#::defaultrust-analyzer cargo oxiri 0.2.11 impl#[VoidOutputBuffer][Default]default().())?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 60 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Selfrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`] { irirust-analyzer cargo oxiri 0.2.11 IriRef#iri., positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions. }) |
| 61 | } |
| 62 | |
| 63 | /// Variant of [`parse`](Self::parse) that assumes that the IRI is valid to skip validation. |
| 64 | /// |
| 65 | /// ``` |
| 66 | /// use oxiri::IriRef; |
| 67 | /// |
| 68 | /// IriRef::parse_unchecked("//foo.com/bar/baz"); |
| 69 | /// ``` |
| 70 | pub fn parse_uncheckedrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`]parse_unchecked().(iri: T) -> Selfrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`] { |
| 71 | let positions = |
| 72 | IriParserrust-analyzer cargo oxiri 0.2.11 IriParser#::<_, true>::parserust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse().(&iri, Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, &mut VoidOutputBufferrust-analyzer cargo oxiri 0.2.11 VoidOutputBuffer#::defaultrust-analyzer cargo oxiri 0.2.11 impl#[VoidOutputBuffer][Default]default().()).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 73 | Selfrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`] { irirust-analyzer cargo oxiri 0.2.11 IriRef#iri., positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions. } |
| 74 | } |
| 75 | |
| 76 | /// Validates and resolved a relative IRI against the current IRI |
| 77 | /// following [RFC 3986](https://www.ietf.org/rfc/rfc3986.html) relative URI resolution algorithm. |
| 78 | /// |
| 79 | /// Use [`resolve_unchecked`](Self::resolve_unchecked) if you already know the IRI is valid to get faster processing. |
| 80 | /// |
| 81 | /// ``` |
| 82 | /// use oxiri::IriRef; |
| 83 | /// |
| 84 | /// let base_iri = IriRef::parse("//foo.com/bar/baz")?; |
| 85 | /// let iri = base_iri.resolve("bat#foo")?; |
| 86 | /// assert_eq!(iri.into_inner(), "//foo.com/bar/bat#foo"); |
| 87 | /// # Result::<(), oxiri::IriParseError>::Ok(()) |
| 88 | /// ``` |
| 89 | pub fn resolverust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`]resolve().(&self, iri: &str) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>, IriParseErrorrust-analyzer cargo oxiri 0.2.11 IriParseError#> { |
| 90 | let mut target_buffer = Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::with_capacityrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]with_capacity().(self.irirust-analyzer cargo oxiri 0.2.11 IriRef#iri..lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]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().iri.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]len().()); |
| 91 | let positions = IriParserrust-analyzer cargo oxiri 0.2.11 IriParser#::<_, false>::parserust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse().(iri, Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(self.as_refrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`]as_ref().()), &mut target_buffer)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 92 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(IriRefrust-analyzer cargo oxiri 0.2.11 IriRef# { |
| 93 | irirust-analyzer cargo oxiri 0.2.11 IriRef#iri.: target_buffer, |
| 94 | positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions., |
| 95 | }) |
| 96 | } |
| 97 | |
| 98 | /// Variant of [`resolve`](Self::resolve) that assumes that the IRI is valid to skip validation. |
| 99 | /// |
| 100 | /// ``` |
| 101 | /// use oxiri::IriRef; |
| 102 | /// |
| 103 | /// let base_iri = IriRef::parse_unchecked("//foo.com/bar/baz"); |
| 104 | /// let iri = base_iri.resolve_unchecked("bat#foo"); |
| 105 | /// assert_eq!(iri.into_inner(), "//foo.com/bar/bat#foo"); |
| 106 | /// ``` |
| 107 | pub fn resolve_uncheckedrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`]resolve_unchecked().(&self, iri: &str) -> IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#> { |
| 108 | let mut target_buffer = Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::with_capacityrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]with_capacity().(self.irirust-analyzer cargo oxiri 0.2.11 IriRef#iri..lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]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().iri.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]len().()); |
| 109 | let positions = |
| 110 | IriParserrust-analyzer cargo oxiri 0.2.11 IriParser#::<_, true>::parserust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse().(iri, Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(self.as_refrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`]as_ref().()), &mut target_buffer).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 111 | IriRefrust-analyzer cargo oxiri 0.2.11 IriRef# { |
| 112 | irirust-analyzer cargo oxiri 0.2.11 IriRef#iri.: target_buffer, |
| 113 | positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions., |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | /// Validates and resolved a relative IRI against the current IRI |
| 118 | /// following [RFC 3986](https://www.ietf.org/rfc/rfc3986.html) relative URI resolution algorithm. |
| 119 | /// |
| 120 | /// It outputs the resolved IRI into `target_buffer` to avoid any memory allocation. |
| 121 | /// |
| 122 | /// Use [`resolve_into_unchecked`](Self::resolve_into_unchecked) if you already know the IRI is valid to get faster processing. |
| 123 | /// |
| 124 | /// ``` |
| 125 | /// use oxiri::IriRef; |
| 126 | /// |
| 127 | /// let base_iri = IriRef::parse("//foo.com/bar/baz")?; |
| 128 | /// let mut result = String::default(); |
| 129 | /// let iri = base_iri.resolve_into("bat#foo", &mut result)?; |
| 130 | /// assert_eq!(result, "//foo.com/bar/bat#foo"); |
| 131 | /// # Result::<(), oxiri::IriParseError>::Ok(()) |
| 132 | /// ``` |
| 133 | pub fn resolve_intorust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`]resolve_into().(&self, iri: &str, target_buffer: &mut Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), IriParseErrorrust-analyzer cargo oxiri 0.2.11 IriParseError#> { |
| 134 | IriParserrust-analyzer cargo oxiri 0.2.11 IriParser#::<_, false>::parserust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse().(iri, Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(self.as_refrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`]as_ref().()), target_buffer)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 135 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()) |
| 136 | } |
| 137 | |
| 138 | /// Variant of [`resolve_into`](Self::resolve_into) that assumes that the IRI is valid to skip validation. |
| 139 | /// |
| 140 | /// ``` |
| 141 | /// use oxiri::IriRef; |
| 142 | /// |
| 143 | /// let base_iri = IriRef::parse_unchecked("//foo.com/bar/baz"); |
| 144 | /// let mut result = String::default(); |
| 145 | /// let iri = base_iri.resolve_into_unchecked("bat#foo", &mut result); |
| 146 | /// assert_eq!(result, "//foo.com/bar/bat#foo"); |
| 147 | /// ``` |
| 148 | pub fn resolve_into_uncheckedrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`]resolve_into_unchecked().(&self, iri: &str, target_buffer: &mut Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#) { |
| 149 | IriParserrust-analyzer cargo oxiri 0.2.11 IriParser#::<_, true>::parserust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse().(iri, Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(self.as_refrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`]as_ref().()), target_buffer).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 150 | } |
| 151 | |
| 152 | /// Returns an `IriRef` borrowing this IRI's text. |
| 153 | #[inline] |
| 154 | pub fn as_refrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`]as_ref().(&self) -> IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<&str> { |
| 155 | IriRefrust-analyzer cargo oxiri 0.2.11 IriRef# { |
| 156 | irirust-analyzer cargo oxiri 0.2.11 IriRef#iri.: &self.irirust-analyzer cargo oxiri 0.2.11 IriRef#iri., |
| 157 | positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions.: self.positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions., |
| 158 | } |
| 159 | } |
| 160 | |
| 161 | /// Returns the underlying IRI representation. |
| 162 | /// |
| 163 | /// ``` |
| 164 | /// use oxiri::IriRef; |
| 165 | /// |
| 166 | /// let iri = IriRef::parse("//example.com/foo")?; |
| 167 | /// assert_eq!(iri.as_str(), "//example.com/foo"); |
| 168 | /// # Result::<(), oxiri::IriParseError>::Ok(()) |
| 169 | /// ``` |
| 170 | #[inline] |
| 171 | pub fn as_strrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`]as_str().(&self) -> &str { |
| 172 | &self.irirust-analyzer cargo oxiri 0.2.11 IriRef#iri. |
| 173 | } |
| 174 | |
| 175 | /// Returns the underlying IRI representation. |
| 176 | /// |
| 177 | /// ``` |
| 178 | /// use oxiri::IriRef; |
| 179 | /// |
| 180 | /// let iri = IriRef::parse("//example.com/foo")?; |
| 181 | /// assert_eq!(iri.into_inner(), "//example.com/foo"); |
| 182 | /// # Result::<(), oxiri::IriParseError>::Ok(()) |
| 183 | /// ``` |
| 184 | #[inline] |
| 185 | pub fn into_innerrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`]into_inner().(self) -> T { |
| 186 | self.irirust-analyzer cargo oxiri 0.2.11 IriRef#iri. |
| 187 | } |
| 188 | |
| 189 | /// Whether this IRI is an absolute IRI reference or not. |
| 190 | /// |
| 191 | /// ``` |
| 192 | /// use oxiri::IriRef; |
| 193 | /// |
| 194 | /// assert!(IriRef::parse("http://example.com/foo")?.is_absolute()); |
| 195 | /// assert!(!IriRef::parse("/foo")?.is_absolute()); |
| 196 | /// # Result::<(), oxiri::IriParseError>::Ok(()) |
| 197 | /// ``` |
| 198 | #[inline] |
| 199 | pub fn is_absoluterust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`]is_absolute().(&self) -> bool { |
| 200 | self.positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..scheme_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#scheme_end. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne().0 |
| 201 | } |
| 202 | |
| 203 | /// Returns the IRI scheme if it exists. |
| 204 | /// |
| 205 | /// Beware: the scheme case is not normalized. Use case insensitive comparisons if you look for a specific scheme. |
| 206 | /// ``` |
| 207 | /// use oxiri::IriRef; |
| 208 | /// |
| 209 | /// let iri = IriRef::parse("hTTp://example.com")?; |
| 210 | /// assert_eq!(iri.scheme(), Some("hTTp")); |
| 211 | /// # Result::<(), oxiri::IriParseError>::Ok(()) |
| 212 | /// ``` |
| 213 | #[inline] |
| 214 | pub fn schemerust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`]scheme().(&self) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<&str> { |
| 215 | if self.positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..scheme_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#scheme_end. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().0 { |
| 216 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# |
| 217 | } else { |
| 218 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(&self.irirust-analyzer cargo oxiri 0.2.11 IriRef#iri.[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/RangeTo#self.positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..scheme_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#scheme_end. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().) |
| 219 | } |
| 220 | } |
| 221 | |
| 222 | /// Returns the IRI authority if it exists. |
| 223 | /// |
| 224 | /// Beware: the host case is not normalized. Use case insensitive comparisons if you look for a specific host. |
| 225 | /// |
| 226 | /// ``` |
| 227 | /// use oxiri::IriRef; |
| 228 | /// |
| 229 | /// let http = IriRef::parse("http://foo:[email protected]:80/my/path")?; |
| 230 | /// assert_eq!(http.authority(), Some("foo:[email protected]:80")); |
| 231 | /// |
| 232 | /// let mailto = IriRef::parse("mailto:[email protected]")?; |
| 233 | /// assert_eq!(mailto.authority(), None); |
| 234 | /// # Result::<(), oxiri::IriParseError>::Ok(()) |
| 235 | /// ``` |
| 236 | #[inline] |
| 237 | pub fn authorityrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`]authority().(&self) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<&str> { |
| 238 | if self.positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..scheme_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#scheme_end. 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 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().self.positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..authority_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#authority_end. { |
| 239 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# |
| 240 | } else { |
| 241 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(&self.irirust-analyzer cargo oxiri 0.2.11 IriRef#iri.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().self.positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..scheme_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#scheme_end. 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..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#self.positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..authority_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#authority_end.]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().) |
| 242 | } |
| 243 | } |
| 244 | |
| 245 | /// Returns the IRI path. |
| 246 | /// |
| 247 | /// ``` |
| 248 | /// use oxiri::IriRef; |
| 249 | /// |
| 250 | /// let http = IriRef::parse("http://foo:[email protected]:80/my/path?foo=bar")?; |
| 251 | /// assert_eq!(http.path(), "/my/path"); |
| 252 | /// |
| 253 | /// let mailto = IriRef::parse("mailto:[email protected]")?; |
| 254 | /// assert_eq!(mailto.path(), "[email protected]"); |
| 255 | /// # Result::<(), oxiri::IriParseError>::Ok(()) |
| 256 | /// ``` |
| 257 | #[inline] |
| 258 | pub fn pathrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`]path().(&self) -> &str { |
| 259 | &self.irirust-analyzer cargo oxiri 0.2.11 IriRef#iri.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().self.positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..authority_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#authority_end...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#self.positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..path_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#path_end.]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index(). |
| 260 | } |
| 261 | |
| 262 | /// Returns the IRI query if it exists. |
| 263 | /// |
| 264 | /// ``` |
| 265 | /// use oxiri::IriRef; |
| 266 | /// |
| 267 | /// let iri = IriRef::parse("http://example.com/my/path?query=foo#frag")?; |
| 268 | /// assert_eq!(iri.query(), Some("query=foo")); |
| 269 | /// # Result::<(), oxiri::IriParseError>::Ok(()) |
| 270 | /// ``` |
| 271 | #[inline] |
| 272 | pub fn queryrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`]query().(&self) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<&str> { |
| 273 | if self.positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..path_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#path_end. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge().>=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge().self.positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..query_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#query_end. { |
| 274 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# |
| 275 | } else { |
| 276 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(&self.irirust-analyzer cargo oxiri 0.2.11 IriRef#iri.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().self.positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..path_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#path_end. 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().1..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#self.positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..query_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#query_end.]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().) |
| 277 | } |
| 278 | } |
| 279 | |
| 280 | /// Returns the IRI fragment if it exists. |
| 281 | /// |
| 282 | /// ``` |
| 283 | /// use oxiri::IriRef; |
| 284 | /// |
| 285 | /// let iri = IriRef::parse("http://example.com/my/path?query=foo#frag")?; |
| 286 | /// assert_eq!(iri.fragment(), Some("frag")); |
| 287 | /// # Result::<(), oxiri::IriParseError>::Ok(()) |
| 288 | /// ``` |
| 289 | #[inline] |
| 290 | pub fn fragmentrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`]fragment().(&self) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<&str> { |
| 291 | if self.positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..query_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#query_end. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge().>=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge().self.irirust-analyzer cargo oxiri 0.2.11 IriRef#iri..lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]len().() { |
| 292 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# |
| 293 | } else { |
| 294 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(&self.irirust-analyzer cargo oxiri 0.2.11 IriRef#iri.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().self.positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..query_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#query_end. 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().1..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFrom#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().) |
| 295 | } |
| 296 | } |
| 297 | } |
| 298 | |
| 299 | impl<Lft: PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#<Rhs>, Rhs> PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#<IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<Rhs>> for IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<Lft> { |
| 300 | #[inline] |
| 301 | fn eqrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<Lft>`][`PartialEq<IriRef<Rhs>>`]eq().(&self, other: &IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<Rhs>) -> bool { |
| 302 | self.irirust-analyzer cargo oxiri 0.2.11 IriRef#iri..eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#eq().(&other.irirust-analyzer cargo oxiri 0.2.11 IriRef#iri.) |
| 303 | } |
| 304 | } |
| 305 | |
| 306 | impl<T: PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#<str>> PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#<str> for IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<T> { |
| 307 | #[inline] |
| 308 | fn eqrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`][`PartialEq<str>`]eq().(&self, other: &str) -> bool { |
| 309 | self.irirust-analyzer cargo oxiri 0.2.11 IriRef#iri..eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#eq().(other) |
| 310 | } |
| 311 | } |
| 312 | |
| 313 | impl<'a, T: PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#<&'a str>> PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#<&'a str> for IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<T> { |
| 314 | #[inline] |
| 315 | fn eqrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`][`PartialEq<&'a str>`]eq().(&self, other: &&'a str) -> bool { |
| 316 | self.irirust-analyzer cargo oxiri 0.2.11 IriRef#iri..eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#eq().(other) |
| 317 | } |
| 318 | } |
| 319 | |
| 320 | impl<T: PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>> PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#> for IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<T> { |
| 321 | #[inline] |
| 322 | fn eqrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`][`PartialEq<String>`]eq().(&self, other: &Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#) -> bool { |
| 323 | self.irirust-analyzer cargo oxiri 0.2.11 IriRef#iri..eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#eq().(other) |
| 324 | } |
| 325 | } |
| 326 | |
| 327 | impl<'a, T: PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#<Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'a, str>>> PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#<Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'a, str>> for IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<T> { |
| 328 | #[inline] |
| 329 | fn eqrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`][`PartialEq<Cow<'a, str>>`]eq().(&self, other: &Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'a, str>) -> bool { |
| 330 | self.irirust-analyzer cargo oxiri 0.2.11 IriRef#iri..eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#eq().(other) |
| 331 | } |
| 332 | } |
| 333 | |
| 334 | impl<T: PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#<str>> PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#<IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<T>> for str { |
| 335 | #[inline] |
| 336 | fn eqrust-analyzer cargo oxiri 0.2.11 impl#[str][`PartialEq<IriRef<T>>`]eq().(&self, other: &IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<T>) -> bool { |
| 337 | other.irirust-analyzer cargo oxiri 0.2.11 IriRef#iri..eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#eq().(self) |
| 338 | } |
| 339 | } |
| 340 | |
| 341 | impl<'a, T: PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#<&'a str>> PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#<IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<T>> for &'a str { |
| 342 | #[inline] |
| 343 | fn eqrust-analyzer cargo oxiri 0.2.11 impl#[`&'a str`][`PartialEq<IriRef<T>>`]eq().(&self, other: &IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<T>) -> bool { |
| 344 | other.irirust-analyzer cargo oxiri 0.2.11 IriRef#iri..eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#eq().(self) |
| 345 | } |
| 346 | } |
| 347 | |
| 348 | impl<T: PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>> PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#<IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<T>> for Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String# { |
| 349 | #[inline] |
| 350 | fn eqrust-analyzer cargo oxiri 0.2.11 impl#[String][`PartialEq<IriRef<T>>`]eq().(&self, other: &IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<T>) -> bool { |
| 351 | other.irirust-analyzer cargo oxiri 0.2.11 IriRef#iri..eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#eq().(self) |
| 352 | } |
| 353 | } |
| 354 | |
| 355 | impl<'a, T: PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#<Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'a, str>>> PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#<IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<T>> for Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'a, str> { |
| 356 | #[inline] |
| 357 | fn eqrust-analyzer cargo oxiri 0.2.11 impl#[`Cow<'a, str>`][`PartialEq<IriRef<T>>`]eq().(&self, other: &IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<T>) -> bool { |
| 358 | other.irirust-analyzer cargo oxiri 0.2.11 IriRef#iri..eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#eq().(self) |
| 359 | } |
| 360 | } |
| 361 | |
| 362 | impl<T: Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq#> Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq# for IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<T> {} |
| 363 | |
| 364 | impl<T: Hashrust-analyzer cargo core https://github.com/rust-lang/rust/library/core hash/Hash#> Hashrust-analyzer cargo core https://github.com/rust-lang/rust/library/core hash/Hash# for IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<T> { |
| 365 | #[inline] |
| 366 | fn hashrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`][Hash]hash().<H: Hasherrust-analyzer cargo core https://github.com/rust-lang/rust/library/core hash/Hasher#>(&self, state: &mut H) { |
| 367 | self.irirust-analyzer cargo oxiri 0.2.11 IriRef#iri..hashrust-analyzer cargo core https://github.com/rust-lang/rust/library/core hash/Hash#hash().(state) |
| 368 | } |
| 369 | } |
| 370 | |
| 371 | impl<Lft: PartialOrdrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialOrd#<Rhs>, Rhs> PartialOrdrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialOrd#<IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<Rhs>> for IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<Lft> { |
| 372 | #[inline] |
| 373 | fn partial_cmprust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<Lft>`][`PartialOrd<IriRef<Rhs>>`]partial_cmp().(&self, other: &IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<Rhs>) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Orderingrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#> { |
| 374 | self.irirust-analyzer cargo oxiri 0.2.11 IriRef#iri..partial_cmprust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialOrd#partial_cmp().(&other.irirust-analyzer cargo oxiri 0.2.11 IriRef#iri.) |
| 375 | } |
| 376 | } |
| 377 | |
| 378 | impl<T: Ordrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ord#> Ordrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ord# for IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<T> { |
| 379 | #[inline] |
| 380 | fn cmprust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`][Ord]cmp().(&self, other: &Selfrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`][Ord]) -> Orderingrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering# { |
| 381 | self.irirust-analyzer cargo oxiri 0.2.11 IriRef#iri..cmprust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ord#cmp().(&other.irirust-analyzer cargo oxiri 0.2.11 IriRef#iri.) |
| 382 | } |
| 383 | } |
| 384 | |
| 385 | impl<T: Derefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref#<Targetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref#Target# = str>> Derefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref# for IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<T> { |
| 386 | type Targetrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`][Deref]Target# = str; |
| 387 | |
| 388 | #[inline] |
| 389 | fn derefrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`][Deref]deref().(&self) -> &str { |
| 390 | self.irirust-analyzer cargo oxiri 0.2.11 IriRef#iri..derefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref#deref().() |
| 391 | } |
| 392 | } |
| 393 | |
| 394 | impl<T: AsRefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/AsRef#<str>> AsRefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/AsRef#<str> for IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<T> { |
| 395 | #[inline] |
| 396 | fn as_refrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`][`AsRef<str>`]as_ref().(&self) -> &str { |
| 397 | self.irirust-analyzer cargo oxiri 0.2.11 IriRef#iri..as_refrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/AsRef#as_ref().() |
| 398 | } |
| 399 | } |
| 400 | |
| 401 | impl<T: Borrowrust-analyzer cargo core https://github.com/rust-lang/rust/library/core borrow/Borrow#<str>> Borrowrust-analyzer cargo core https://github.com/rust-lang/rust/library/core borrow/Borrow#<str> for IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<T> { |
| 402 | #[inline] |
| 403 | fn borrowrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`][`Borrow<str>`]borrow().(&self) -> &str { |
| 404 | self.irirust-analyzer cargo oxiri 0.2.11 IriRef#iri..borrowrust-analyzer cargo core https://github.com/rust-lang/rust/library/core borrow/Borrow#borrow().() |
| 405 | } |
| 406 | } |
| 407 | |
| 408 | impl<T: fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug#> fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug# for IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<T> { |
| 409 | #[inline] |
| 410 | fn fmtrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`][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# { |
| 411 | self.irirust-analyzer cargo oxiri 0.2.11 IriRef#iri..fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug#fmt().(f) |
| 412 | } |
| 413 | } |
| 414 | |
| 415 | impl<T: fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display#> fmtrust-analyzer cargo 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 IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<T> { |
| 416 | #[inline] |
| 417 | fn fmtrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`][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# { |
| 418 | self.irirust-analyzer cargo oxiri 0.2.11 IriRef#iri..fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display#fmt().(f) |
| 419 | } |
| 420 | } |
| 421 | |
| 422 | impl FromStrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/traits/FromStr# for IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#> { |
| 423 | type Errrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<String>`][FromStr]Err# = IriParseErrorrust-analyzer cargo oxiri 0.2.11 IriParseError#; |
| 424 | |
| 425 | #[inline] |
| 426 | fn from_strrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<String>`][FromStr]from_str().(iri: &str) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<String>`][FromStr], IriParseErrorrust-analyzer cargo oxiri 0.2.11 IriParseError#> { |
| 427 | Selfrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<String>`][FromStr]::parserust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`]parse().(iri.to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str][ToOwned]to_owned().()) |
| 428 | } |
| 429 | } |
| 430 | |
| 431 | impl<'a> Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<&'a str>> for IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#> { |
| 432 | #[inline] |
| 433 | fn fromrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<String>`][`From<IriRef<&'a str>>`]from().(iri: IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<&'a str>) -> Selfrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<String>`][`From<IriRef<&'a str>>`] { |
| 434 | Selfrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<String>`][`From<IriRef<&'a str>>`] { |
| 435 | irirust-analyzer cargo oxiri 0.2.11 IriRef#iri.: iri.irirust-analyzer cargo oxiri 0.2.11 IriRef#iri..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), |
| 436 | positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions.: iri.positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions., |
| 437 | } |
| 438 | } |
| 439 | } |
| 440 | |
| 441 | impl<'a> Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'a, str>>> for IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#> { |
| 442 | #[inline] |
| 443 | fn fromrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<String>`][`From<IriRef<Cow<'a, str>>>`]from().(iri: IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'a, str>>) -> Selfrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<String>`][`From<IriRef<Cow<'a, str>>>`] { |
| 444 | Selfrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<String>`][`From<IriRef<Cow<'a, str>>>`] { |
| 445 | irirust-analyzer cargo oxiri 0.2.11 IriRef#iri.: iri.irirust-analyzer cargo oxiri 0.2.11 IriRef#iri..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), |
| 446 | positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions.: iri.positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions., |
| 447 | } |
| 448 | } |
| 449 | } |
| 450 | |
| 451 | impl Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<str>>> for IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#> { |
| 452 | #[inline] |
| 453 | fn fromrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<String>`][`From<IriRef<Box<str>>>`]from().(iri: IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<str>>) -> Selfrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<String>`][`From<IriRef<Box<str>>>`] { |
| 454 | Selfrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<String>`][`From<IriRef<Box<str>>>`] { |
| 455 | irirust-analyzer cargo oxiri 0.2.11 IriRef#iri.: iri.irirust-analyzer cargo oxiri 0.2.11 IriRef#iri..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), |
| 456 | positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions.: iri.positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions., |
| 457 | } |
| 458 | } |
| 459 | } |
| 460 | |
| 461 | impl<'a> Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<&'a str>> for IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'a, str>> { |
| 462 | #[inline] |
| 463 | fn fromrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<Cow<'a, str>>`][`From<IriRef<&'a str>>`]from().(iri: IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<&'a str>) -> Selfrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<Cow<'a, str>>`][`From<IriRef<&'a str>>`] { |
| 464 | Selfrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<Cow<'a, str>>`][`From<IriRef<&'a str>>`] { |
| 465 | irirust-analyzer cargo oxiri 0.2.11 IriRef#iri.: iri.irirust-analyzer cargo oxiri 0.2.11 IriRef#iri..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), |
| 466 | positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions.: iri.positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions., |
| 467 | } |
| 468 | } |
| 469 | } |
| 470 | |
| 471 | impl Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>> for IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'_, str>> { |
| 472 | #[inline] |
| 473 | fn fromrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<Cow<'_, str>>`][`From<IriRef<String>>`]from().(iri: IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>) -> Selfrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<Cow<'_, str>>`][`From<IriRef<String>>`] { |
| 474 | Selfrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<Cow<'_, str>>`][`From<IriRef<String>>`] { |
| 475 | irirust-analyzer cargo oxiri 0.2.11 IriRef#iri.: iri.irirust-analyzer cargo oxiri 0.2.11 IriRef#iri..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), |
| 476 | positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions.: iri.positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions., |
| 477 | } |
| 478 | } |
| 479 | } |
| 480 | |
| 481 | impl<'a> Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<&'a IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>> for IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<&'a str> { |
| 482 | #[inline] |
| 483 | fn fromrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<&'a str>`][`From<&'a IriRef<String>>`]from().(iri: &'a IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>) -> Selfrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<&'a str>`][`From<&'a IriRef<String>>`] { |
| 484 | Selfrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<&'a str>`][`From<&'a IriRef<String>>`] { |
| 485 | irirust-analyzer cargo oxiri 0.2.11 IriRef#iri.: &iri.irirust-analyzer cargo oxiri 0.2.11 IriRef#iri., |
| 486 | positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions.: iri.positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions., |
| 487 | } |
| 488 | } |
| 489 | } |
| 490 | |
| 491 | impl<'a> Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<&'a IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'a, str>>> for IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<&'a str> { |
| 492 | #[inline] |
| 493 | fn fromrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<&'a str>`][`From<&'a IriRef<Cow<'a, str>>>`]from().(iri: &'a IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'a, str>>) -> Selfrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<&'a str>`][`From<&'a IriRef<Cow<'a, str>>>`] { |
| 494 | Selfrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<&'a str>`][`From<&'a IriRef<Cow<'a, str>>>`] { |
| 495 | irirust-analyzer cargo oxiri 0.2.11 IriRef#iri.: &iri.irirust-analyzer cargo oxiri 0.2.11 IriRef#iri., |
| 496 | positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions.: iri.positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions., |
| 497 | } |
| 498 | } |
| 499 | } |
| 500 | |
| 501 | #[cfg(feature = "serde")] |
| 502 | impl<T: Serializerust-analyzer cargo serde_core 1.0.229 ser/Serialize#> Serializerust-analyzer cargo serde_core 1.0.229 ser/Serialize# for IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<T> { |
| 503 | fn serializerust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`][Serialize]serialize().<S: Serializerrust-analyzer cargo serde_core 1.0.229 ser/Serializer#>(&self, serializer: S) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<S::Okrust-analyzer cargo serde_core 1.0.229 ser/Serializer#Ok#, S::Errorrust-analyzer cargo serde_core 1.0.229 ser/Serializer#Error#> { |
| 504 | self.irirust-analyzer cargo oxiri 0.2.11 IriRef#iri..serializerust-analyzer cargo serde_core 1.0.229 ser/Serialize#serialize().(serializer) |
| 505 | } |
| 506 | } |
| 507 | |
| 508 | #[cfg(feature = "serde")] |
| 509 | impl<'de, T: Derefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref#<Targetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref#Target# = str> + Deserializerust-analyzer cargo serde_core 1.0.229 de/Deserialize#<'de>> Deserializerust-analyzer cargo serde_core 1.0.229 de/Deserialize#<'de> for IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<T> { |
| 510 | fn deserializerust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`][`Deserialize<'de>`]deserialize().<D: Deserializerrust-analyzer cargo serde_core 1.0.229 de/Deserializer#<'de>>(deserializer: D) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`][`Deserialize<'de>`], D::Errorrust-analyzer cargo serde_core 1.0.229 de/Deserializer#Error#> { |
| 511 | use serderust-analyzer cargo serde 1.0.229 crate/::derust-analyzer cargo serde_core 1.0.229 de/::Errorrust-analyzer cargo serde_core 1.0.229 de/Error#; |
| 512 | |
| 513 | Selfrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`][`Deserialize<'de>`]::parserust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`]parse().(T::deserializerust-analyzer cargo serde_core 1.0.229 de/Deserialize#deserialize().(deserializer)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().).map_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map_err().(Errorrust-analyzer cargo serde_core 1.0.229 de/Error#::customrust-analyzer cargo serde_core 1.0.229 de/Error#custom().) |
| 514 | } |
| 515 | } |
| 516 | |
| 517 | /// A [RFC 3987](https://www.ietf.org/rfc/rfc3987.html) IRI. |
| 518 | /// |
| 519 | /// Instances of this type are guaranteed to be absolute, |
| 520 | /// unlike [`IriRef`]. |
| 521 | /// |
| 522 | /// ``` |
| 523 | /// use std::convert::TryFrom; |
| 524 | /// use oxiri::{Iri, IriRef}; |
| 525 | /// |
| 526 | /// // Parse and validate base IRI |
| 527 | /// let base_iri = Iri::parse("http://foo.com/bar/baz")?; |
| 528 | /// |
| 529 | /// // Validate and resolve relative IRI |
| 530 | /// let iri = base_iri.resolve("bat#foo")?; |
| 531 | /// assert_eq!(iri.into_inner(), "http://foo.com/bar/bat#foo"); |
| 532 | /// |
| 533 | /// // Iri::parse will err on relative IRIs. |
| 534 | /// assert!(Iri::parse("../bar/baz").is_err()); |
| 535 | /// |
| 536 | /// // It is possible to build an Iri from an IriRef object |
| 537 | /// Iri::try_from(IriRef::parse("http://foo.com/bar")?)?; |
| 538 | /// # Result::<(), oxiri::IriParseError>::Ok(()) |
| 539 | /// ``` |
| 540 | #[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:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:)] |
| 541 | pub struct Irirust-analyzer cargo oxiri 0.2.11 Iri#<T>(IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<T>); |
| 542 | |
| 543 | impl<T: Derefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref#<Targetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref#Target# = str>> Irirust-analyzer cargo oxiri 0.2.11 Iri#<T> { |
| 544 | /// Parses and validates the IRI following the grammar from [RFC 3987](https://www.ietf.org/rfc/rfc3987.html). |
| 545 | /// |
| 546 | /// This operation keeps internally the `iri` parameter and does not allocate. |
| 547 | /// |
| 548 | /// Use [`parse_unchecked`](Self::parse_unchecked) if you already know the IRI is valid to get faster processing. |
| 549 | /// |
| 550 | /// ``` |
| 551 | /// use oxiri::Iri; |
| 552 | /// |
| 553 | /// Iri::parse("http://foo.com/bar/baz")?; |
| 554 | /// # Result::<(), oxiri::IriParseError>::Ok(()) |
| 555 | /// ``` |
| 556 | pub fn parserust-analyzer cargo oxiri 0.2.11 impl#[`Iri<T>`]parse().(iri: T) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<T>`], IriParseErrorrust-analyzer cargo oxiri 0.2.11 IriParseError#> { |
| 557 | IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#::parserust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`]parse().(iri)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()..try_intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`TryInto<U>`]try_into().() |
| 558 | } |
| 559 | |
| 560 | /// Variant of [`parse`](Self::parse) that assumes that the IRI is valid to skip validation. |
| 561 | /// |
| 562 | /// ``` |
| 563 | /// use oxiri::Iri; |
| 564 | /// |
| 565 | /// Iri::parse_unchecked("http://foo.com/bar/baz"); |
| 566 | /// ``` |
| 567 | pub fn parse_uncheckedrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<T>`]parse_unchecked().(iri: T) -> Selfrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<T>`] { |
| 568 | Irirust-analyzer cargo oxiri 0.2.11 Iri#(IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#::parse_uncheckedrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`]parse_unchecked().(iri)) |
| 569 | } |
| 570 | |
| 571 | /// Validates and resolved a relative IRI against the current IRI |
| 572 | /// following [RFC 3986](https://www.ietf.org/rfc/rfc3986.html) relative URI resolution algorithm. |
| 573 | /// |
| 574 | /// Use [`resolve_unchecked`](Self::resolve_unchecked) if you already know the IRI is valid to get faster processing. |
| 575 | /// |
| 576 | /// ``` |
| 577 | /// use oxiri::Iri; |
| 578 | /// |
| 579 | /// let base_iri = Iri::parse("http://foo.com/bar/baz")?; |
| 580 | /// let iri = base_iri.resolve("bat#foo")?; |
| 581 | /// assert_eq!(iri.into_inner(), "http://foo.com/bar/bat#foo"); |
| 582 | /// # Result::<(), oxiri::IriParseError>::Ok(()) |
| 583 | /// ``` |
| 584 | pub fn resolverust-analyzer cargo oxiri 0.2.11 impl#[`Iri<T>`]resolve().(&self, iri: &str) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Irirust-analyzer cargo oxiri 0.2.11 Iri#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>, IriParseErrorrust-analyzer cargo oxiri 0.2.11 IriParseError#> { |
| 585 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Irirust-analyzer cargo oxiri 0.2.11 Iri#(self.0rust-analyzer cargo oxiri 0.2.11 Iri#0..resolverust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`]resolve().(iri)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().)) |
| 586 | } |
| 587 | |
| 588 | /// Variant of [`resolve`](Self::resolve) that assumes that the IRI is valid to skip validation. |
| 589 | /// |
| 590 | /// ``` |
| 591 | /// use oxiri::Iri; |
| 592 | /// |
| 593 | /// let base_iri = Iri::parse_unchecked("http://foo.com/bar/baz"); |
| 594 | /// let iri = base_iri.resolve_unchecked("bat#foo"); |
| 595 | /// assert_eq!(iri.into_inner(), "http://foo.com/bar/bat#foo"); |
| 596 | /// ``` |
| 597 | pub fn resolve_uncheckedrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<T>`]resolve_unchecked().(&self, iri: &str) -> Irirust-analyzer cargo oxiri 0.2.11 Iri#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#> { |
| 598 | Irirust-analyzer cargo oxiri 0.2.11 Iri#(self.0rust-analyzer cargo oxiri 0.2.11 Iri#0..resolve_uncheckedrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`]resolve_unchecked().(iri)) |
| 599 | } |
| 600 | |
| 601 | /// Validates and resolved a relative IRI against the current IRI |
| 602 | /// following [RFC 3986](https://www.ietf.org/rfc/rfc3986.html) relative URI resolution algorithm. |
| 603 | /// |
| 604 | /// It outputs the resolved IRI into `target_buffer` to avoid any memory allocation. |
| 605 | /// |
| 606 | /// Use [`resolve_into_unchecked`](Self::resolve_into_unchecked) if you already know the IRI is valid to get faster processing. |
| 607 | /// |
| 608 | /// ``` |
| 609 | /// use oxiri::Iri; |
| 610 | /// |
| 611 | /// let base_iri = Iri::parse("http://foo.com/bar/baz")?; |
| 612 | /// let mut result = String::default(); |
| 613 | /// let iri = base_iri.resolve_into("bat#foo", &mut result)?; |
| 614 | /// assert_eq!(result, "http://foo.com/bar/bat#foo"); |
| 615 | /// # Result::<(), oxiri::IriParseError>::Ok(()) |
| 616 | /// ``` |
| 617 | pub fn resolve_intorust-analyzer cargo oxiri 0.2.11 impl#[`Iri<T>`]resolve_into().(&self, iri: &str, target_buffer: &mut Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), IriParseErrorrust-analyzer cargo oxiri 0.2.11 IriParseError#> { |
| 618 | self.0rust-analyzer cargo oxiri 0.2.11 Iri#0..resolve_intorust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`]resolve_into().(iri, target_buffer) |
| 619 | } |
| 620 | |
| 621 | /// Variant of [`resolve_into`](Self::resolve_into) that assumes that the IRI is valid to skip validation. |
| 622 | /// |
| 623 | /// ``` |
| 624 | /// use oxiri::Iri; |
| 625 | /// |
| 626 | /// let base_iri = Iri::parse_unchecked("http://foo.com/bar/baz"); |
| 627 | /// let mut result = String::default(); |
| 628 | /// let iri = base_iri.resolve_into_unchecked("bat#foo", &mut result); |
| 629 | /// assert_eq!(result, "http://foo.com/bar/bat#foo"); |
| 630 | /// ``` |
| 631 | pub fn resolve_into_uncheckedrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<T>`]resolve_into_unchecked().(&self, iri: &str, target_buffer: &mut Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#) { |
| 632 | self.0rust-analyzer cargo oxiri 0.2.11 Iri#0..resolve_into_uncheckedrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`]resolve_into_unchecked().(iri, target_buffer) |
| 633 | } |
| 634 | |
| 635 | /// Returns an IRI that, when resolved against the current IRI returns `abs`. |
| 636 | /// |
| 637 | /// This function returns an error |
| 638 | /// if is not possible to build a relative IRI that can resolve to the same IRI. |
| 639 | /// For example, when the path contains `/../`. |
| 640 | /// |
| 641 | /// Note that the output of this function might change in minor releases. |
| 642 | /// |
| 643 | /// ``` |
| 644 | /// use oxiri::Iri; |
| 645 | /// |
| 646 | /// let base_iri = Iri::parse("http://foo.com/bar/baz")?; |
| 647 | /// let iri = Iri::parse("http://foo.com/bar/bat#foo")?; |
| 648 | /// let relative_iri = base_iri.relativize(&iri)?; |
| 649 | /// assert_eq!(relative_iri, "bat#foo"); |
| 650 | /// # Result::<(), Box<dyn std::error::Error>>::Ok(()) |
| 651 | /// ``` |
| 652 | pub fn relativizerust-analyzer cargo oxiri 0.2.11 impl#[`Iri<T>`]relativize().<T2: Derefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref#<Targetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref#Target# = str>>( |
| 653 | &self, |
| 654 | abs: &Irirust-analyzer cargo oxiri 0.2.11 Iri#<T2>, |
| 655 | ) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>, IriRelativizeErrorrust-analyzer cargo oxiri 0.2.11 IriRelativizeError#> { |
| 656 | let base = self; |
| 657 | let abs_authority = abs.authorityrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<T>`]authority().(); |
| 658 | let base_authority = base.authorityrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<T>`]authority().(); |
| 659 | let abs_path = abs.pathrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<T>`]path().(); |
| 660 | let base_path = base.pathrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<T>`]path().(); |
| 661 | let abs_query = abs.queryrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<T>`]query().(); |
| 662 | let base_query = base.queryrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<T>`]query().(); |
| 663 | |
| 664 | // We validate the path, resolving algorithm eats /. and /.. in hierarchical path |
| 665 | for segment in abs_path.splitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]split().('/') { |
| 666 | if matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/matches!!(segment, "." | "..") { |
| 667 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(IriRelativizeErrorrust-analyzer cargo oxiri 0.2.11 IriRelativizeError# {}); |
| 668 | } |
| 669 | } |
| 670 | |
| 671 | if abs.schemerust-analyzer cargo oxiri 0.2.11 impl#[`Iri<T>`]scheme().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]ne().base.schemerust-analyzer cargo oxiri 0.2.11 impl#[`Iri<T>`]scheme().() |
| 672 | || abs_authority.is_nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_none().() |
| 673 | && (base_authority.is_somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_some().() |
| 674 | || abs_path.is_emptyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]is_empty().() |
| 675 | && (!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().base_path.is_emptyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]is_empty().() || abs_query.is_nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_none().() && base_query.is_somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_some().())) |
| 676 | || abs_path |
| 677 | // Might confuse with a scheme |
| 678 | .split_oncerust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]split_once().(':') |
| 679 | .map_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]map_or().(false, |(candidate_scheme, _)| { |
| 680 | !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().candidate_scheme.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().('/') |
| 681 | }) |
| 682 | { |
| 683 | return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(IriRefrust-analyzer cargo oxiri 0.2.11 IriRef# { |
| 684 | irirust-analyzer cargo oxiri 0.2.11 IriRef#iri.: abs.0rust-analyzer cargo oxiri 0.2.11 Iri#0..to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(), |
| 685 | positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions.: abs.0rust-analyzer cargo oxiri 0.2.11 Iri#0..positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions., |
| 686 | }); |
| 687 | } |
| 688 | if abs_authority rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne().base_authority |
| 689 | // the resolution algorithm does not handle empty paths: |
| 690 | || abs_path.is_emptyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]is_empty().() && (!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().base_path.is_emptyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]is_empty().() || base_query.is_somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_some().()) |
| 691 | // confusion with authority: |
| 692 | || abs_path.starts_withrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]starts_with().("//") |
| 693 | { |
| 694 | return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(IriRefrust-analyzer cargo oxiri 0.2.11 IriRef# { |
| 695 | irirust-analyzer cargo oxiri 0.2.11 IriRef#iri.: abs.0rust-analyzer cargo oxiri 0.2.11 Iri#0.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().abs.0rust-analyzer cargo oxiri 0.2.11 Iri#0..positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..scheme_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#scheme_end...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFrom#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()..to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(), |
| 696 | positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions.: IriElementsPositionsrust-analyzer cargo oxiri 0.2.11 IriElementsPositions# { |
| 697 | scheme_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#scheme_end.: 0, |
| 698 | authority_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#authority_end.: abs.0rust-analyzer cargo oxiri 0.2.11 Iri#0..positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..authority_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#authority_end. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().abs.0rust-analyzer cargo oxiri 0.2.11 Iri#0..positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..scheme_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#scheme_end., |
| 699 | path_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#path_end.: abs.0rust-analyzer cargo oxiri 0.2.11 Iri#0..positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..path_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#path_end. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().abs.0rust-analyzer cargo oxiri 0.2.11 Iri#0..positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..scheme_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#scheme_end., |
| 700 | query_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#query_end.: abs.0rust-analyzer cargo oxiri 0.2.11 Iri#0..positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..query_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#query_end. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().abs.0rust-analyzer cargo oxiri 0.2.11 Iri#0..positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..scheme_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#scheme_end., |
| 701 | }, |
| 702 | }); |
| 703 | } |
| 704 | if abs_path rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]ne().base_path || abs_query.is_nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_none().() && base_query.is_somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_some().() { |
| 705 | let number_of_shared_characters = abs_path |
| 706 | .charsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]chars().() |
| 707 | .ziprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#zip().(base_path.charsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]chars().()) |
| 708 | .take_whilerust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#take_while().(|(l, r)| l 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().r) |
| 709 | .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|(l, _)| l.len_utf8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core char/methods/impl#[char]len_utf8().()) |
| 710 | .sumrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#sum().::<usize>(); |
| 711 | // We decrease until finding a / |
| 712 | let number_of_shared_characters = abs_path[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/RangeTo#number_of_shared_characters]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index(). |
| 713 | .rfindrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]rfind().('/') |
| 714 | .map_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]map_or().(0, |n| n 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().1); |
| 715 | return if abs_path[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().number_of_shared_characters..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFrom#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()..starts_withrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]starts_with().('/') |
| 716 | || base_path[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().number_of_shared_characters..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFrom#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()..containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().('/') |
| 717 | || abs_path[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().number_of_shared_characters..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFrom#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()..containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().(':') |
| 718 | { |
| 719 | // We output the full path because we have a / or an empty end |
| 720 | if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().abs_path.starts_withrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]starts_with().('/') && !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().base_path.is_emptyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]is_empty().() { |
| 721 | // We output the full IRI because we have a path that does not start with /, |
| 722 | // so it can't be considered as absolute |
| 723 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(IriRefrust-analyzer cargo oxiri 0.2.11 IriRef# { |
| 724 | irirust-analyzer cargo oxiri 0.2.11 IriRef#iri.: abs.0rust-analyzer cargo oxiri 0.2.11 Iri#0..to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(), |
| 725 | positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions.: abs.0rust-analyzer cargo oxiri 0.2.11 Iri#0..positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions., |
| 726 | }) |
| 727 | } else { |
| 728 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(IriRefrust-analyzer cargo oxiri 0.2.11 IriRef# { |
| 729 | irirust-analyzer cargo oxiri 0.2.11 IriRef#iri.: abs.0rust-analyzer cargo oxiri 0.2.11 Iri#0.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().abs.0rust-analyzer cargo oxiri 0.2.11 Iri#0..positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..authority_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#authority_end...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFrom#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()..to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(), |
| 730 | positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions.: IriElementsPositionsrust-analyzer cargo oxiri 0.2.11 IriElementsPositions# { |
| 731 | scheme_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#scheme_end.: 0, |
| 732 | authority_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#authority_end.: 0, |
| 733 | path_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#path_end.: abs.0rust-analyzer cargo oxiri 0.2.11 Iri#0..positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..path_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#path_end. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().abs.0rust-analyzer cargo oxiri 0.2.11 Iri#0..positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..authority_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#authority_end., |
| 734 | query_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#query_end.: abs.0rust-analyzer cargo oxiri 0.2.11 Iri#0..positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..query_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#query_end. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().abs.0rust-analyzer cargo oxiri 0.2.11 Iri#0..positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..authority_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#authority_end., |
| 735 | }, |
| 736 | }) |
| 737 | } |
| 738 | } else if abs_path[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().number_of_shared_characters..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFrom#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()..is_emptyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]is_empty().() { |
| 739 | // We use "." |
| 740 | let mut iri = Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::with_capacityrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]with_capacity().( |
| 741 | abs.0rust-analyzer cargo oxiri 0.2.11 Iri#0..lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().abs.0rust-analyzer cargo oxiri 0.2.11 Iri#0..positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..authority_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#authority_end. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().number_of_shared_characters 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().1, |
| 742 | ); |
| 743 | iri.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push().('.'); |
| 744 | iri.push_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push_str().(&abs.0rust-analyzer cargo oxiri 0.2.11 Iri#0.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().abs.0rust-analyzer cargo oxiri 0.2.11 Iri#0..positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..authority_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#authority_end. 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().number_of_shared_characters..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFrom#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().); |
| 745 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(IriRefrust-analyzer cargo oxiri 0.2.11 IriRef# { |
| 746 | irirust-analyzer cargo oxiri 0.2.11 IriRef#iri., |
| 747 | positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions.: IriElementsPositionsrust-analyzer cargo oxiri 0.2.11 IriElementsPositions# { |
| 748 | scheme_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#scheme_end.: 0, |
| 749 | authority_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#authority_end.: 0, |
| 750 | path_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#path_end.: abs.0rust-analyzer cargo oxiri 0.2.11 Iri#0..positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..path_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#path_end. |
| 751 | -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().abs.0rust-analyzer cargo oxiri 0.2.11 Iri#0..positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..authority_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#authority_end. |
| 752 | -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().number_of_shared_characters |
| 753 | +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().1, |
| 754 | query_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#query_end.: abs.0rust-analyzer cargo oxiri 0.2.11 Iri#0..positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..query_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#query_end. |
| 755 | -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().abs.0rust-analyzer cargo oxiri 0.2.11 Iri#0..positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..authority_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#authority_end. |
| 756 | -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().number_of_shared_characters |
| 757 | +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().1, |
| 758 | }, |
| 759 | }) |
| 760 | } else { |
| 761 | // We just override the last element |
| 762 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(IriRefrust-analyzer cargo oxiri 0.2.11 IriRef# { |
| 763 | irirust-analyzer cargo oxiri 0.2.11 IriRef#iri.: abs.0rust-analyzer cargo oxiri 0.2.11 Iri#0.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().abs.0rust-analyzer cargo oxiri 0.2.11 Iri#0..positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..authority_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#authority_end. 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().number_of_shared_characters..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFrom#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index(). |
| 764 | .to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(), |
| 765 | positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions.: IriElementsPositionsrust-analyzer cargo oxiri 0.2.11 IriElementsPositions# { |
| 766 | scheme_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#scheme_end.: 0, |
| 767 | authority_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#authority_end.: 0, |
| 768 | path_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#path_end.: abs.0rust-analyzer cargo oxiri 0.2.11 Iri#0..positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..path_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#path_end. |
| 769 | -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().abs.0rust-analyzer cargo oxiri 0.2.11 Iri#0..positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..authority_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#authority_end. |
| 770 | -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().number_of_shared_characters, |
| 771 | query_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#query_end.: abs.0rust-analyzer cargo oxiri 0.2.11 Iri#0..positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..query_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#query_end. |
| 772 | -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().abs.0rust-analyzer cargo oxiri 0.2.11 Iri#0..positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..authority_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#authority_end. |
| 773 | -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().number_of_shared_characters, |
| 774 | }, |
| 775 | }) |
| 776 | }; |
| 777 | } |
| 778 | if abs_query rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne().base_query { |
| 779 | return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(IriRefrust-analyzer cargo oxiri 0.2.11 IriRef# { |
| 780 | irirust-analyzer cargo oxiri 0.2.11 IriRef#iri.: abs.0rust-analyzer cargo oxiri 0.2.11 Iri#0.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().abs.0rust-analyzer cargo oxiri 0.2.11 Iri#0..positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..path_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#path_end...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFrom#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()..to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(), |
| 781 | positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions.: IriElementsPositionsrust-analyzer cargo oxiri 0.2.11 IriElementsPositions# { |
| 782 | scheme_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#scheme_end.: 0, |
| 783 | authority_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#authority_end.: 0, |
| 784 | path_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#path_end.: 0, |
| 785 | query_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#query_end.: abs.0rust-analyzer cargo oxiri 0.2.11 Iri#0..positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..query_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#query_end. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().abs.0rust-analyzer cargo oxiri 0.2.11 Iri#0..positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..path_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#path_end., |
| 786 | }, |
| 787 | }); |
| 788 | } |
| 789 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(IriRefrust-analyzer cargo oxiri 0.2.11 IriRef# { |
| 790 | irirust-analyzer cargo oxiri 0.2.11 IriRef#iri.: abs.0rust-analyzer cargo oxiri 0.2.11 Iri#0.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().abs.0rust-analyzer cargo oxiri 0.2.11 Iri#0..positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..query_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#query_end...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFrom#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()..to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(), |
| 791 | positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions.: IriElementsPositionsrust-analyzer cargo oxiri 0.2.11 IriElementsPositions# { |
| 792 | scheme_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#scheme_end.: 0, |
| 793 | authority_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#authority_end.: 0, |
| 794 | path_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#path_end.: 0, |
| 795 | query_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#query_end.: 0, |
| 796 | }, |
| 797 | }) |
| 798 | } |
| 799 | |
| 800 | /// Returns an IRI borrowing this IRI's text |
| 801 | #[inline] |
| 802 | pub fn as_refrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<T>`]as_ref().(&self) -> Irirust-analyzer cargo oxiri 0.2.11 Iri#<&str> { |
| 803 | Irirust-analyzer cargo oxiri 0.2.11 Iri#(self.0rust-analyzer cargo oxiri 0.2.11 Iri#0..as_refrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`]as_ref().()) |
| 804 | } |
| 805 | |
| 806 | /// Returns the underlying IRI representation. |
| 807 | /// |
| 808 | /// ``` |
| 809 | /// use oxiri::Iri; |
| 810 | /// |
| 811 | /// let iri = Iri::parse("http://example.com/foo")?; |
| 812 | /// assert_eq!(iri.as_str(), "http://example.com/foo"); |
| 813 | /// # Result::<(), oxiri::IriParseError>::Ok(()) |
| 814 | /// ``` |
| 815 | #[inline] |
| 816 | pub fn as_strrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<T>`]as_str().(&self) -> &str { |
| 817 | self.0rust-analyzer cargo oxiri 0.2.11 Iri#0..as_strrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`]as_str().() |
| 818 | } |
| 819 | |
| 820 | /// Returns the underlying IRI representation. |
| 821 | /// |
| 822 | /// ``` |
| 823 | /// use oxiri::Iri; |
| 824 | /// |
| 825 | /// let iri = Iri::parse("http://example.com/foo")?; |
| 826 | /// assert_eq!(iri.into_inner(), "http://example.com/foo"); |
| 827 | /// # Result::<(), oxiri::IriParseError>::Ok(()) |
| 828 | /// ``` |
| 829 | #[inline] |
| 830 | pub fn into_innerrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<T>`]into_inner().(self) -> T { |
| 831 | self.0rust-analyzer cargo oxiri 0.2.11 Iri#0..into_innerrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`]into_inner().() |
| 832 | } |
| 833 | |
| 834 | /// Returns the IRI scheme. |
| 835 | /// |
| 836 | /// Beware: the scheme case is not normalized. Use case insensitive comparisons if you look for a specific scheme. |
| 837 | /// |
| 838 | /// ``` |
| 839 | /// use oxiri::Iri; |
| 840 | /// |
| 841 | /// let iri = Iri::parse("hTTp://example.com")?; |
| 842 | /// assert_eq!(iri.scheme(), "hTTp"); |
| 843 | /// # Result::<(), oxiri::IriParseError>::Ok(()) |
| 844 | /// ``` |
| 845 | #[inline] |
| 846 | pub fn schemerust-analyzer cargo oxiri 0.2.11 impl#[`Iri<T>`]scheme().(&self) -> &str { |
| 847 | self.0rust-analyzer cargo oxiri 0.2.11 Iri#0..schemerust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`]scheme().().expectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]expect().("The IRI should be absolute") |
| 848 | } |
| 849 | |
| 850 | /// Returns the IRI authority if it exists. |
| 851 | /// |
| 852 | /// Beware: the host case is not normalized. Use case insensitive comparisons if you look for a specific host. |
| 853 | /// |
| 854 | /// ``` |
| 855 | /// use oxiri::Iri; |
| 856 | /// |
| 857 | /// let http = Iri::parse("http://foo:[email protected]:80/my/path")?; |
| 858 | /// assert_eq!(http.authority(), Some("foo:[email protected]:80")); |
| 859 | /// |
| 860 | /// let mailto = Iri::parse("mailto:[email protected]")?; |
| 861 | /// assert_eq!(mailto.authority(), None); |
| 862 | /// # Result::<(), oxiri::IriParseError>::Ok(()) |
| 863 | /// ``` |
| 864 | #[inline] |
| 865 | pub fn authorityrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<T>`]authority().(&self) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<&str> { |
| 866 | self.0rust-analyzer cargo oxiri 0.2.11 Iri#0..authorityrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`]authority().() |
| 867 | } |
| 868 | |
| 869 | /// Returns the IRI path. |
| 870 | /// |
| 871 | /// ``` |
| 872 | /// use oxiri::Iri; |
| 873 | /// |
| 874 | /// let http = Iri::parse("http://foo:[email protected]:80/my/path?foo=bar")?; |
| 875 | /// assert_eq!(http.path(), "/my/path"); |
| 876 | /// |
| 877 | /// let mailto = Iri::parse("mailto:[email protected]")?; |
| 878 | /// assert_eq!(mailto.path(), "[email protected]"); |
| 879 | /// # Result::<(), oxiri::IriParseError>::Ok(()) |
| 880 | /// ``` |
| 881 | #[inline] |
| 882 | pub fn pathrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<T>`]path().(&self) -> &str { |
| 883 | self.0rust-analyzer cargo oxiri 0.2.11 Iri#0..pathrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`]path().() |
| 884 | } |
| 885 | |
| 886 | /// Returns the IRI query if it exists. |
| 887 | /// |
| 888 | /// ``` |
| 889 | /// use oxiri::Iri; |
| 890 | /// |
| 891 | /// let iri = Iri::parse("http://example.com/my/path?query=foo#frag")?; |
| 892 | /// assert_eq!(iri.query(), Some("query=foo")); |
| 893 | /// # Result::<(), oxiri::IriParseError>::Ok(()) |
| 894 | /// ``` |
| 895 | #[inline] |
| 896 | pub fn queryrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<T>`]query().(&self) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<&str> { |
| 897 | self.0rust-analyzer cargo oxiri 0.2.11 Iri#0..queryrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`]query().() |
| 898 | } |
| 899 | |
| 900 | /// Returns the IRI fragment if it exists. |
| 901 | /// |
| 902 | /// ``` |
| 903 | /// use oxiri::Iri; |
| 904 | /// |
| 905 | /// let iri = Iri::parse("http://example.com/my/path?query=foo#frag")?; |
| 906 | /// assert_eq!(iri.fragment(), Some("frag")); |
| 907 | /// # Result::<(), oxiri::IriParseError>::Ok(()) |
| 908 | /// ``` |
| 909 | #[inline] |
| 910 | pub fn fragmentrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<T>`]fragment().(&self) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<&str> { |
| 911 | self.0rust-analyzer cargo oxiri 0.2.11 Iri#0..fragmentrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`]fragment().() |
| 912 | } |
| 913 | } |
| 914 | |
| 915 | impl<Lft: PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#<Rhs>, Rhs> PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#<Irirust-analyzer cargo oxiri 0.2.11 Iri#<Rhs>> for Irirust-analyzer cargo oxiri 0.2.11 Iri#<Lft> { |
| 916 | #[inline] |
| 917 | fn eqrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<Lft>`][`PartialEq<Iri<Rhs>>`]eq().(&self, other: &Irirust-analyzer cargo oxiri 0.2.11 Iri#<Rhs>) -> bool { |
| 918 | self.0rust-analyzer cargo oxiri 0.2.11 Iri#0..eqrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<Lft>`][`PartialEq<IriRef<Rhs>>`]eq().(&other.0rust-analyzer cargo oxiri 0.2.11 Iri#0.) |
| 919 | } |
| 920 | } |
| 921 | |
| 922 | impl<Lft: PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#<Rhs>, Rhs> PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#<IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<Rhs>> for Irirust-analyzer cargo oxiri 0.2.11 Iri#<Lft> { |
| 923 | #[inline] |
| 924 | fn eqrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<Lft>`][`PartialEq<IriRef<Rhs>>`]eq().(&self, other: &IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<Rhs>) -> bool { |
| 925 | self.0rust-analyzer cargo oxiri 0.2.11 Iri#0..eqrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<Lft>`][`PartialEq<IriRef<Rhs>>`]eq().(other) |
| 926 | } |
| 927 | } |
| 928 | |
| 929 | impl<Lft: PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#<Rhs>, Rhs> PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#<Irirust-analyzer cargo oxiri 0.2.11 Iri#<Rhs>> for IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<Lft> { |
| 930 | #[inline] |
| 931 | fn eqrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<Lft>`][`PartialEq<Iri<Rhs>>`]eq().(&self, other: &Irirust-analyzer cargo oxiri 0.2.11 Iri#<Rhs>) -> bool { |
| 932 | self.eqrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<Lft>`][`PartialEq<IriRef<Rhs>>`]eq().(&other.0rust-analyzer cargo oxiri 0.2.11 Iri#0.) |
| 933 | } |
| 934 | } |
| 935 | |
| 936 | impl<T: PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#<str>> PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#<str> for Irirust-analyzer cargo oxiri 0.2.11 Iri#<T> { |
| 937 | #[inline] |
| 938 | fn eqrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<T>`][`PartialEq<str>`]eq().(&self, other: &str) -> bool { |
| 939 | self.0rust-analyzer cargo oxiri 0.2.11 Iri#0..eqrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`][`PartialEq<str>`]eq().(other) |
| 940 | } |
| 941 | } |
| 942 | |
| 943 | impl<'a, T: PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#<&'a str>> PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#<&'a str> for Irirust-analyzer cargo oxiri 0.2.11 Iri#<T> { |
| 944 | #[inline] |
| 945 | fn eqrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<T>`][`PartialEq<&'a str>`]eq().(&self, other: &&'a str) -> bool { |
| 946 | self.0rust-analyzer cargo oxiri 0.2.11 Iri#0..eqrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`][`PartialEq<&'a str>`]eq().(other) |
| 947 | } |
| 948 | } |
| 949 | |
| 950 | impl<T: PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>> PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#> for Irirust-analyzer cargo oxiri 0.2.11 Iri#<T> { |
| 951 | #[inline] |
| 952 | fn eqrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<T>`][`PartialEq<String>`]eq().(&self, other: &Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#) -> bool { |
| 953 | self.0rust-analyzer cargo oxiri 0.2.11 Iri#0..eqrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`][`PartialEq<String>`]eq().(other) |
| 954 | } |
| 955 | } |
| 956 | |
| 957 | impl<'a, T: PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#<Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'a, str>>> PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#<Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'a, str>> for Irirust-analyzer cargo oxiri 0.2.11 Iri#<T> { |
| 958 | #[inline] |
| 959 | fn eqrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<T>`][`PartialEq<Cow<'a, str>>`]eq().(&self, other: &Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'a, str>) -> bool { |
| 960 | self.0rust-analyzer cargo oxiri 0.2.11 Iri#0..eqrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`][`PartialEq<Cow<'a, str>>`]eq().(other) |
| 961 | } |
| 962 | } |
| 963 | |
| 964 | impl<T: PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#<str>> PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#<Irirust-analyzer cargo oxiri 0.2.11 Iri#<T>> for str { |
| 965 | #[inline] |
| 966 | fn eqrust-analyzer cargo oxiri 0.2.11 impl#[str][`PartialEq<Iri<T>>`]eq().(&self, other: &Irirust-analyzer cargo oxiri 0.2.11 Iri#<T>) -> bool { |
| 967 | self.eqrust-analyzer cargo oxiri 0.2.11 impl#[str][`PartialEq<IriRef<T>>`]eq().(&other.0rust-analyzer cargo oxiri 0.2.11 Iri#0.) |
| 968 | } |
| 969 | } |
| 970 | |
| 971 | impl<'a, T: PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#<&'a str>> PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#<Irirust-analyzer cargo oxiri 0.2.11 Iri#<T>> for &'a str { |
| 972 | #[inline] |
| 973 | fn eqrust-analyzer cargo oxiri 0.2.11 impl#[`&'a str`][`PartialEq<Iri<T>>`]eq().(&self, other: &Irirust-analyzer cargo oxiri 0.2.11 Iri#<T>) -> bool { |
| 974 | self.eqrust-analyzer cargo oxiri 0.2.11 impl#[`&'a str`][`PartialEq<IriRef<T>>`]eq().(&other.0rust-analyzer cargo oxiri 0.2.11 Iri#0.) |
| 975 | } |
| 976 | } |
| 977 | |
| 978 | impl<T: PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>> PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#<Irirust-analyzer cargo oxiri 0.2.11 Iri#<T>> for Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String# { |
| 979 | #[inline] |
| 980 | fn eqrust-analyzer cargo oxiri 0.2.11 impl#[String][`PartialEq<Iri<T>>`]eq().(&self, other: &Irirust-analyzer cargo oxiri 0.2.11 Iri#<T>) -> bool { |
| 981 | self.eqrust-analyzer cargo oxiri 0.2.11 impl#[String][`PartialEq<IriRef<T>>`]eq().(&other.0rust-analyzer cargo oxiri 0.2.11 Iri#0.) |
| 982 | } |
| 983 | } |
| 984 | |
| 985 | impl<'a, T: PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#<Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'a, str>>> PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#<Irirust-analyzer cargo oxiri 0.2.11 Iri#<T>> for Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'a, str> { |
| 986 | #[inline] |
| 987 | fn eqrust-analyzer cargo oxiri 0.2.11 impl#[`Cow<'a, str>`][`PartialEq<Iri<T>>`]eq().(&self, other: &Irirust-analyzer cargo oxiri 0.2.11 Iri#<T>) -> bool { |
| 988 | self.eqrust-analyzer cargo oxiri 0.2.11 impl#[`Cow<'a, str>`][`PartialEq<IriRef<T>>`]eq().(&other.0rust-analyzer cargo oxiri 0.2.11 Iri#0.) |
| 989 | } |
| 990 | } |
| 991 | |
| 992 | impl<T: Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq#> Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq# for Irirust-analyzer cargo oxiri 0.2.11 Iri#<T> {} |
| 993 | |
| 994 | impl<T: Hashrust-analyzer cargo core https://github.com/rust-lang/rust/library/core hash/Hash#> Hashrust-analyzer cargo core https://github.com/rust-lang/rust/library/core hash/Hash# for Irirust-analyzer cargo oxiri 0.2.11 Iri#<T> { |
| 995 | #[inline] |
| 996 | fn hashrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<T>`][Hash]hash().<H: Hasherrust-analyzer cargo core https://github.com/rust-lang/rust/library/core hash/Hasher#>(&self, state: &mut H) { |
| 997 | self.0rust-analyzer cargo oxiri 0.2.11 Iri#0..hashrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`][Hash]hash().(state) |
| 998 | } |
| 999 | } |
| 1000 | |
| 1001 | impl<Lft: PartialOrdrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialOrd#<Rhs>, Rhs> PartialOrdrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialOrd#<Irirust-analyzer cargo oxiri 0.2.11 Iri#<Rhs>> for Irirust-analyzer cargo oxiri 0.2.11 Iri#<Lft> { |
| 1002 | #[inline] |
| 1003 | fn partial_cmprust-analyzer cargo oxiri 0.2.11 impl#[`Iri<Lft>`][`PartialOrd<Iri<Rhs>>`]partial_cmp().(&self, other: &Irirust-analyzer cargo oxiri 0.2.11 Iri#<Rhs>) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Orderingrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#> { |
| 1004 | self.0rust-analyzer cargo oxiri 0.2.11 Iri#0..partial_cmprust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<Lft>`][`PartialOrd<IriRef<Rhs>>`]partial_cmp().(&other.0rust-analyzer cargo oxiri 0.2.11 Iri#0.) |
| 1005 | } |
| 1006 | } |
| 1007 | |
| 1008 | impl<Lft: PartialOrdrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialOrd#<Rhs>, Rhs> PartialOrdrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialOrd#<IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<Rhs>> for Irirust-analyzer cargo oxiri 0.2.11 Iri#<Lft> { |
| 1009 | #[inline] |
| 1010 | fn partial_cmprust-analyzer cargo oxiri 0.2.11 impl#[`Iri<Lft>`][`PartialOrd<IriRef<Rhs>>`]partial_cmp().(&self, other: &IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<Rhs>) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Orderingrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#> { |
| 1011 | self.0rust-analyzer cargo oxiri 0.2.11 Iri#0..partial_cmprust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<Lft>`][`PartialOrd<IriRef<Rhs>>`]partial_cmp().(other) |
| 1012 | } |
| 1013 | } |
| 1014 | |
| 1015 | impl<Lft: PartialOrdrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialOrd#<Rhs>, Rhs> PartialOrdrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialOrd#<Irirust-analyzer cargo oxiri 0.2.11 Iri#<Rhs>> for IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<Lft> { |
| 1016 | #[inline] |
| 1017 | fn partial_cmprust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<Lft>`][`PartialOrd<Iri<Rhs>>`]partial_cmp().(&self, other: &Irirust-analyzer cargo oxiri 0.2.11 Iri#<Rhs>) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Orderingrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering#> { |
| 1018 | self.partial_cmprust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<Lft>`][`PartialOrd<IriRef<Rhs>>`]partial_cmp().(&other.0rust-analyzer cargo oxiri 0.2.11 Iri#0.) |
| 1019 | } |
| 1020 | } |
| 1021 | |
| 1022 | impl<T: Ordrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ord#> Ordrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ord# for Irirust-analyzer cargo oxiri 0.2.11 Iri#<T> { |
| 1023 | #[inline] |
| 1024 | fn cmprust-analyzer cargo oxiri 0.2.11 impl#[`Iri<T>`][Ord]cmp().(&self, other: &Selfrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<T>`][Ord]) -> Orderingrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ordering# { |
| 1025 | self.0rust-analyzer cargo oxiri 0.2.11 Iri#0..cmprust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`][Ord]cmp().(&other.0rust-analyzer cargo oxiri 0.2.11 Iri#0.) |
| 1026 | } |
| 1027 | } |
| 1028 | |
| 1029 | impl<T: Derefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref#<Targetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref#Target# = str>> Derefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref# for Irirust-analyzer cargo oxiri 0.2.11 Iri#<T> { |
| 1030 | type Targetrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<T>`][Deref]Target# = str; |
| 1031 | |
| 1032 | #[inline] |
| 1033 | fn derefrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<T>`][Deref]deref().(&self) -> &str { |
| 1034 | self.0rust-analyzer cargo oxiri 0.2.11 Iri#0..derefrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`][Deref]deref().() |
| 1035 | } |
| 1036 | } |
| 1037 | |
| 1038 | impl<T: AsRefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/AsRef#<str>> AsRefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/AsRef#<str> for Irirust-analyzer cargo oxiri 0.2.11 Iri#<T> { |
| 1039 | #[inline] |
| 1040 | fn as_refrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<T>`][`AsRef<str>`]as_ref().(&self) -> &str { |
| 1041 | self.0rust-analyzer cargo oxiri 0.2.11 Iri#0..as_refrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`][`AsRef<str>`]as_ref().() |
| 1042 | } |
| 1043 | } |
| 1044 | |
| 1045 | impl<T: Borrowrust-analyzer cargo core https://github.com/rust-lang/rust/library/core borrow/Borrow#<str>> Borrowrust-analyzer cargo core https://github.com/rust-lang/rust/library/core borrow/Borrow#<str> for Irirust-analyzer cargo oxiri 0.2.11 Iri#<T> { |
| 1046 | #[inline] |
| 1047 | fn borrowrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<T>`][`Borrow<str>`]borrow().(&self) -> &str { |
| 1048 | self.0rust-analyzer cargo oxiri 0.2.11 Iri#0..borrowrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`][`Borrow<str>`]borrow().() |
| 1049 | } |
| 1050 | } |
| 1051 | |
| 1052 | impl<T: fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug#> fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug# for Irirust-analyzer cargo oxiri 0.2.11 Iri#<T> { |
| 1053 | #[inline] |
| 1054 | fn fmtrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<T>`][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# { |
| 1055 | self.0rust-analyzer cargo oxiri 0.2.11 Iri#0..fmtrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`][Debug]fmt().(f) |
| 1056 | } |
| 1057 | } |
| 1058 | |
| 1059 | impl<T: fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display#> fmtrust-analyzer cargo 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 Irirust-analyzer cargo oxiri 0.2.11 Iri#<T> { |
| 1060 | #[inline] |
| 1061 | fn fmtrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<T>`][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# { |
| 1062 | self.0rust-analyzer cargo oxiri 0.2.11 Iri#0..fmtrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`][Display]fmt().(f) |
| 1063 | } |
| 1064 | } |
| 1065 | |
| 1066 | impl FromStrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/traits/FromStr# for Irirust-analyzer cargo oxiri 0.2.11 Iri#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#> { |
| 1067 | type Errrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<String>`][FromStr]Err# = IriParseErrorrust-analyzer cargo oxiri 0.2.11 IriParseError#; |
| 1068 | |
| 1069 | #[inline] |
| 1070 | fn from_strrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<String>`][FromStr]from_str().(iri: &str) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<String>`][FromStr], IriParseErrorrust-analyzer cargo oxiri 0.2.11 IriParseError#> { |
| 1071 | Selfrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<String>`][FromStr]::parserust-analyzer cargo oxiri 0.2.11 impl#[`Iri<T>`]parse().(iri.to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str][ToOwned]to_owned().()) |
| 1072 | } |
| 1073 | } |
| 1074 | |
| 1075 | impl<'a> Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<Irirust-analyzer cargo oxiri 0.2.11 Iri#<&'a str>> for Irirust-analyzer cargo oxiri 0.2.11 Iri#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#> { |
| 1076 | #[inline] |
| 1077 | fn fromrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<String>`][`From<Iri<&'a str>>`]from().(iri: Irirust-analyzer cargo oxiri 0.2.11 Iri#<&'a str>) -> Selfrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<String>`][`From<Iri<&'a str>>`] { |
| 1078 | Selfrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<String>`][`From<Iri<&'a str>>`](iri.0rust-analyzer cargo oxiri 0.2.11 Iri#0..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()) |
| 1079 | } |
| 1080 | } |
| 1081 | |
| 1082 | impl<'a> Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<Irirust-analyzer cargo oxiri 0.2.11 Iri#<Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'a, str>>> for Irirust-analyzer cargo oxiri 0.2.11 Iri#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#> { |
| 1083 | #[inline] |
| 1084 | fn fromrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<String>`][`From<Iri<Cow<'a, str>>>`]from().(iri: Irirust-analyzer cargo oxiri 0.2.11 Iri#<Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'a, str>>) -> Selfrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<String>`][`From<Iri<Cow<'a, str>>>`] { |
| 1085 | Selfrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<String>`][`From<Iri<Cow<'a, str>>>`](iri.0rust-analyzer cargo oxiri 0.2.11 Iri#0..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()) |
| 1086 | } |
| 1087 | } |
| 1088 | |
| 1089 | impl Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<Irirust-analyzer cargo oxiri 0.2.11 Iri#<Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<str>>> for Irirust-analyzer cargo oxiri 0.2.11 Iri#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#> { |
| 1090 | #[inline] |
| 1091 | fn fromrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<String>`][`From<Iri<Box<str>>>`]from().(iri: Irirust-analyzer cargo oxiri 0.2.11 Iri#<Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<str>>) -> Selfrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<String>`][`From<Iri<Box<str>>>`] { |
| 1092 | Selfrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<String>`][`From<Iri<Box<str>>>`](iri.0rust-analyzer cargo oxiri 0.2.11 Iri#0..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()) |
| 1093 | } |
| 1094 | } |
| 1095 | |
| 1096 | impl<'a> Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<Irirust-analyzer cargo oxiri 0.2.11 Iri#<&'a str>> for Irirust-analyzer cargo oxiri 0.2.11 Iri#<Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'a, str>> { |
| 1097 | #[inline] |
| 1098 | fn fromrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<Cow<'a, str>>`][`From<Iri<&'a str>>`]from().(iri: Irirust-analyzer cargo oxiri 0.2.11 Iri#<&'a str>) -> Selfrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<Cow<'a, str>>`][`From<Iri<&'a str>>`] { |
| 1099 | Selfrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<Cow<'a, str>>`][`From<Iri<&'a str>>`](iri.0rust-analyzer cargo oxiri 0.2.11 Iri#0..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()) |
| 1100 | } |
| 1101 | } |
| 1102 | |
| 1103 | impl Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<Irirust-analyzer cargo oxiri 0.2.11 Iri#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>> for Irirust-analyzer cargo oxiri 0.2.11 Iri#<Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'_, str>> { |
| 1104 | #[inline] |
| 1105 | fn fromrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<Cow<'_, str>>`][`From<Iri<String>>`]from().(iri: Irirust-analyzer cargo oxiri 0.2.11 Iri#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>) -> Selfrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<Cow<'_, str>>`][`From<Iri<String>>`] { |
| 1106 | Selfrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<Cow<'_, str>>`][`From<Iri<String>>`](iri.0rust-analyzer cargo oxiri 0.2.11 Iri#0..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()) |
| 1107 | } |
| 1108 | } |
| 1109 | |
| 1110 | impl<'a> Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<&'a Irirust-analyzer cargo oxiri 0.2.11 Iri#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>> for Irirust-analyzer cargo oxiri 0.2.11 Iri#<&'a str> { |
| 1111 | #[inline] |
| 1112 | fn fromrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<&'a str>`][`From<&'a Iri<String>>`]from().(iri: &'a Irirust-analyzer cargo oxiri 0.2.11 Iri#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>) -> Selfrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<&'a str>`][`From<&'a Iri<String>>`] { |
| 1113 | Selfrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<&'a str>`][`From<&'a Iri<String>>`](iri.0rust-analyzer cargo oxiri 0.2.11 Iri#0..as_refrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`]as_ref().()) |
| 1114 | } |
| 1115 | } |
| 1116 | |
| 1117 | impl<'a> Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<&'a Irirust-analyzer cargo oxiri 0.2.11 Iri#<Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'a, str>>> for Irirust-analyzer cargo oxiri 0.2.11 Iri#<&'a str> { |
| 1118 | #[inline] |
| 1119 | fn fromrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<&'a str>`][`From<&'a Iri<Cow<'a, str>>>`]from().(iri: &'a Irirust-analyzer cargo oxiri 0.2.11 Iri#<Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'a, str>>) -> Selfrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<&'a str>`][`From<&'a Iri<Cow<'a, str>>>`] { |
| 1120 | Selfrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<&'a str>`][`From<&'a Iri<Cow<'a, str>>>`](iri.0rust-analyzer cargo oxiri 0.2.11 Iri#0..as_refrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`]as_ref().()) |
| 1121 | } |
| 1122 | } |
| 1123 | |
| 1124 | impl<T: Derefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref#<Targetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref#Target# = str>> Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<Irirust-analyzer cargo oxiri 0.2.11 Iri#<T>> for IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<T> { |
| 1125 | fn fromrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`][`From<Iri<T>>`]from().(iri: Irirust-analyzer cargo oxiri 0.2.11 Iri#<T>) -> Selfrust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`][`From<Iri<T>>`] { |
| 1126 | iri.0rust-analyzer cargo oxiri 0.2.11 Iri#0. |
| 1127 | } |
| 1128 | } |
| 1129 | |
| 1130 | impl<T: Derefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref#<Targetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref#Target# = str>> TryFromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/TryFrom#<IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<T>> for Irirust-analyzer cargo oxiri 0.2.11 Iri#<T> { |
| 1131 | type Errorrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<T>`][`TryFrom<IriRef<T>>`]Error# = IriParseErrorrust-analyzer cargo oxiri 0.2.11 IriParseError#; |
| 1132 | |
| 1133 | fn try_fromrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<T>`][`TryFrom<IriRef<T>>`]try_from().(iri: IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<T>) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<T>`][`TryFrom<IriRef<T>>`], IriParseErrorrust-analyzer cargo oxiri 0.2.11 IriParseError#> { |
| 1134 | if iri.is_absoluterust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`]is_absolute().() { |
| 1135 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Selfrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<T>`][`TryFrom<IriRef<T>>`](iri)) |
| 1136 | } else { |
| 1137 | Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(IriParseErrorrust-analyzer cargo oxiri 0.2.11 IriParseError# { |
| 1138 | kindrust-analyzer cargo oxiri 0.2.11 IriParseError#kind.: IriParseErrorKindrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#::NoSchemerust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#NoScheme#, |
| 1139 | }) |
| 1140 | } |
| 1141 | } |
| 1142 | } |
| 1143 | |
| 1144 | #[cfg(feature = "serde")] |
| 1145 | impl<T: Serializerust-analyzer cargo serde_core 1.0.229 ser/Serialize#> Serializerust-analyzer cargo serde_core 1.0.229 ser/Serialize# for Irirust-analyzer cargo oxiri 0.2.11 Iri#<T> { |
| 1146 | fn serializerust-analyzer cargo oxiri 0.2.11 impl#[`Iri<T>`][Serialize]serialize().<S: Serializerrust-analyzer cargo serde_core 1.0.229 ser/Serializer#>(&self, serializer: S) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<S::Okrust-analyzer cargo serde_core 1.0.229 ser/Serializer#Ok#, S::Errorrust-analyzer cargo serde_core 1.0.229 ser/Serializer#Error#> { |
| 1147 | self.0rust-analyzer cargo oxiri 0.2.11 Iri#0..serializerust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`][Serialize]serialize().(serializer) |
| 1148 | } |
| 1149 | } |
| 1150 | |
| 1151 | #[cfg(feature = "serde")] |
| 1152 | impl<'de, T: Derefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref#<Targetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref#Target# = str> + Deserializerust-analyzer cargo serde_core 1.0.229 de/Deserialize#<'de>> Deserializerust-analyzer cargo serde_core 1.0.229 de/Deserialize#<'de> for Irirust-analyzer cargo oxiri 0.2.11 Iri#<T> { |
| 1153 | fn deserializerust-analyzer cargo oxiri 0.2.11 impl#[`Iri<T>`][`Deserialize<'de>`]deserialize().<D: Deserializerrust-analyzer cargo serde_core 1.0.229 de/Deserializer#<'de>>(deserializer: D) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo oxiri 0.2.11 impl#[`Iri<T>`][`Deserialize<'de>`], D::Errorrust-analyzer cargo serde_core 1.0.229 de/Deserializer#Error#> { |
| 1154 | use serderust-analyzer cargo serde 1.0.229 crate/::derust-analyzer cargo serde_core 1.0.229 de/::Errorrust-analyzer cargo serde_core 1.0.229 de/Error#; |
| 1155 | IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#::deserializerust-analyzer cargo oxiri 0.2.11 impl#[`IriRef<T>`][`Deserialize<'de>`]deserialize().(deserializer)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). |
| 1156 | .try_intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`TryInto<U>`]try_into().() |
| 1157 | .map_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map_err().(Errorrust-analyzer cargo serde_core 1.0.229 de/Error#::customrust-analyzer cargo serde_core 1.0.229 de/Error#custom().) |
| 1158 | } |
| 1159 | } |
| 1160 | |
| 1161 | /// An error raised during [`Iri`] or [`IriRef`] validation. |
| 1162 | #[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:)] |
| 1163 | pub struct IriParseErrorrust-analyzer cargo oxiri 0.2.11 IriParseError# { |
| 1164 | kindrust-analyzer cargo oxiri 0.2.11 IriParseError#kind.: IriParseErrorKindrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#, |
| 1165 | } |
| 1166 | |
| 1167 | 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 IriParseErrorrust-analyzer cargo oxiri 0.2.11 IriParseError# { |
| 1168 | fn fmtrust-analyzer cargo oxiri 0.2.11 impl#[IriParseError][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# { |
| 1169 | match &self.kindrust-analyzer cargo oxiri 0.2.11 IriParseError#kind. { |
| 1170 | IriParseErrorKindrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#::NoSchemerust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#NoScheme# => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "No scheme found in an absolute IRI"), |
| 1171 | IriParseErrorKindrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#::InvalidHostCharacterrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#InvalidHostCharacter#(c) => { |
| 1172 | writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "Invalid character '{c}' in host") |
| 1173 | } |
| 1174 | IriParseErrorKindrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#::InvalidHostIprust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#InvalidHostIp#(e) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "Invalid host IP ({e})"), |
| 1175 | IriParseErrorKindrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#::InvalidPortCharacterrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#InvalidPortCharacter#(c) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "Invalid character '{c}'"), |
| 1176 | IriParseErrorKindrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#::InvalidIriCodePointrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#InvalidIriCodePoint#(c) => { |
| 1177 | writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "Invalid IRI code point '{c}'") |
| 1178 | } |
| 1179 | IriParseErrorKindrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#::InvalidPercentEncodingrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#InvalidPercentEncoding#(cs) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!( |
| 1180 | f, |
| 1181 | "Invalid IRI percent encoding '{}'", |
| 1182 | cs.iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().().flattenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#flatten().().clonedrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#cloned().().collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().::<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>() |
| 1183 | ), |
| 1184 | IriParseErrorKindrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#::PathStartingWithTwoSlashesrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#PathStartingWithTwoSlashes# => { |
| 1185 | writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "An IRI path is not allowed to start with //") |
| 1186 | } |
| 1187 | } |
| 1188 | } |
| 1189 | } |
| 1190 | |
| 1191 | impl Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error# for IriParseErrorrust-analyzer cargo oxiri 0.2.11 IriParseError# { |
| 1192 | fn sourcerust-analyzer cargo oxiri 0.2.11 impl#[IriParseError][Error]source().(&self) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<&(dyn Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error# + 'static)> { |
| 1193 | if let IriParseErrorKindrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#::InvalidHostIprust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#InvalidHostIp#(e) = &self.kindrust-analyzer cargo oxiri 0.2.11 IriParseError#kind. { |
| 1194 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(e) |
| 1195 | } else { |
| 1196 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# |
| 1197 | } |
| 1198 | } |
| 1199 | } |
| 1200 | |
| 1201 | #[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:)] |
| 1202 | enum IriParseErrorKindrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind# { |
| 1203 | NoSchemerust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#NoScheme#, |
| 1204 | InvalidHostCharacterrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#InvalidHostCharacter#(char), |
| 1205 | InvalidHostIprust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#InvalidHostIp#(AddrParseErrorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/parser/AddrParseError#), |
| 1206 | InvalidPortCharacterrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#InvalidPortCharacter#(char), |
| 1207 | InvalidIriCodePointrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#InvalidIriCodePoint#(char), |
| 1208 | InvalidPercentEncodingrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#InvalidPercentEncoding#([Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<char>; 3]), |
| 1209 | PathStartingWithTwoSlashesrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#PathStartingWithTwoSlashes#, |
| 1210 | } |
| 1211 | |
| 1212 | /// An error raised when calling [`Iri::relativize`]. |
| 1213 | /// |
| 1214 | /// It can happen when it is not possible to build a relative IRI that can resolve to the same IRI. |
| 1215 | /// For example, when the path contains `/../`. |
| 1216 | #[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:)] |
| 1217 | pub struct IriRelativizeErrorrust-analyzer cargo oxiri 0.2.11 IriRelativizeError# {} |
| 1218 | |
| 1219 | 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 IriRelativizeErrorrust-analyzer cargo oxiri 0.2.11 IriRelativizeError# { |
| 1220 | fn fmtrust-analyzer cargo oxiri 0.2.11 impl#[IriRelativizeError][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# { |
| 1221 | writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!( |
| 1222 | f, |
| 1223 | "It is not possible to make this IRI relative because it contains `/..` or `/.`" |
| 1224 | ) |
| 1225 | } |
| 1226 | } |
| 1227 | |
| 1228 | impl Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error# for IriRelativizeErrorrust-analyzer cargo oxiri 0.2.11 IriRelativizeError# {} |
| 1229 | |
| 1230 | #[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:, 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:)] |
| 1231 | struct IriElementsPositionsrust-analyzer cargo oxiri 0.2.11 IriElementsPositions# { |
| 1232 | scheme_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#scheme_end.: usize, |
| 1233 | authority_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#authority_end.: usize, |
| 1234 | path_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#path_end.: usize, |
| 1235 | query_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#query_end.: usize, |
| 1236 | } |
| 1237 | |
| 1238 | trait OutputBufferrust-analyzer cargo oxiri 0.2.11 OutputBuffer# { |
| 1239 | fn pushrust-analyzer cargo oxiri 0.2.11 OutputBuffer#push().(&mut self, c: char); |
| 1240 | |
| 1241 | fn push_strrust-analyzer cargo oxiri 0.2.11 OutputBuffer#push_str().(&mut self, s: &str); |
| 1242 | |
| 1243 | fn clearrust-analyzer cargo oxiri 0.2.11 OutputBuffer#clear().(&mut self); |
| 1244 | |
| 1245 | fn truncaterust-analyzer cargo oxiri 0.2.11 OutputBuffer#truncate().(&mut self, new_len: usize); |
| 1246 | |
| 1247 | fn lenrust-analyzer cargo oxiri 0.2.11 OutputBuffer#len().(&self) -> usize; |
| 1248 | |
| 1249 | fn as_strrust-analyzer cargo oxiri 0.2.11 OutputBuffer#as_str().(&self) -> &str; |
| 1250 | } |
| 1251 | |
| 1252 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default:)] |
| 1253 | struct VoidOutputBufferrust-analyzer cargo oxiri 0.2.11 VoidOutputBuffer# { |
| 1254 | lenrust-analyzer cargo oxiri 0.2.11 VoidOutputBuffer#len.: usize, |
| 1255 | } |
| 1256 | |
| 1257 | impl OutputBufferrust-analyzer cargo oxiri 0.2.11 OutputBuffer# for VoidOutputBufferrust-analyzer cargo oxiri 0.2.11 VoidOutputBuffer# { |
| 1258 | #[inline] |
| 1259 | fn pushrust-analyzer cargo oxiri 0.2.11 impl#[VoidOutputBuffer][OutputBuffer]push().(&mut self, c: char) { |
| 1260 | self.lenrust-analyzer cargo oxiri 0.2.11 VoidOutputBuffer#len. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().c.len_utf8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core char/methods/impl#[char]len_utf8().(); |
| 1261 | } |
| 1262 | |
| 1263 | #[inline] |
| 1264 | fn push_strrust-analyzer cargo oxiri 0.2.11 impl#[VoidOutputBuffer][OutputBuffer]push_str().(&mut self, s: &str) { |
| 1265 | self.lenrust-analyzer cargo oxiri 0.2.11 VoidOutputBuffer#len. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().s.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]len().(); |
| 1266 | } |
| 1267 | |
| 1268 | #[inline] |
| 1269 | fn clearrust-analyzer cargo oxiri 0.2.11 impl#[VoidOutputBuffer][OutputBuffer]clear().(&mut self) { |
| 1270 | self.lenrust-analyzer cargo oxiri 0.2.11 VoidOutputBuffer#len. = 0; |
| 1271 | } |
| 1272 | |
| 1273 | #[inline] |
| 1274 | fn truncaterust-analyzer cargo oxiri 0.2.11 impl#[VoidOutputBuffer][OutputBuffer]truncate().(&mut self, new_len: usize) { |
| 1275 | self.lenrust-analyzer cargo oxiri 0.2.11 VoidOutputBuffer#len. = new_len; |
| 1276 | } |
| 1277 | |
| 1278 | #[inline] |
| 1279 | fn lenrust-analyzer cargo oxiri 0.2.11 impl#[VoidOutputBuffer][OutputBuffer]len().(&self) -> usize { |
| 1280 | self.lenrust-analyzer cargo oxiri 0.2.11 VoidOutputBuffer#len. |
| 1281 | } |
| 1282 | |
| 1283 | #[inline] |
| 1284 | fn as_strrust-analyzer cargo oxiri 0.2.11 impl#[VoidOutputBuffer][OutputBuffer]as_str().(&self) -> &str { |
| 1285 | "" |
| 1286 | } |
| 1287 | } |
| 1288 | |
| 1289 | impl OutputBufferrust-analyzer cargo oxiri 0.2.11 OutputBuffer# for Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String# { |
| 1290 | #[inline] |
| 1291 | fn pushrust-analyzer cargo oxiri 0.2.11 impl#[String][OutputBuffer]push().(&mut self, c: char) { |
| 1292 | self.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push().(c); |
| 1293 | } |
| 1294 | |
| 1295 | #[inline] |
| 1296 | fn push_strrust-analyzer cargo oxiri 0.2.11 impl#[String][OutputBuffer]push_str().(&mut self, s: &str) { |
| 1297 | self.push_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push_str().(s); |
| 1298 | } |
| 1299 | |
| 1300 | #[inline] |
| 1301 | fn clearrust-analyzer cargo oxiri 0.2.11 impl#[String][OutputBuffer]clear().(&mut self) { |
| 1302 | self.clearrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]clear().(); |
| 1303 | } |
| 1304 | |
| 1305 | #[inline] |
| 1306 | fn truncaterust-analyzer cargo oxiri 0.2.11 impl#[String][OutputBuffer]truncate().(&mut self, new_len: usize) { |
| 1307 | self.truncaterust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]truncate().(new_len); |
| 1308 | } |
| 1309 | |
| 1310 | #[inline] |
| 1311 | fn lenrust-analyzer cargo oxiri 0.2.11 impl#[String][OutputBuffer]len().(&self) -> usize { |
| 1312 | self.lenrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]len().() |
| 1313 | } |
| 1314 | |
| 1315 | #[inline] |
| 1316 | fn as_strrust-analyzer cargo oxiri 0.2.11 impl#[String][OutputBuffer]as_str().(&self) -> &str { |
| 1317 | self.as_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]as_str().() |
| 1318 | } |
| 1319 | } |
| 1320 | |
| 1321 | struct ParserInputrust-analyzer cargo oxiri 0.2.11 ParserInput#<'a> { |
| 1322 | valuerust-analyzer cargo oxiri 0.2.11 ParserInput#value.: Charsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/iter/Chars#<'a>, |
| 1323 | positionrust-analyzer cargo oxiri 0.2.11 ParserInput#position.: usize, |
| 1324 | } |
| 1325 | |
| 1326 | impl ParserInputrust-analyzer cargo oxiri 0.2.11 ParserInput#<'_> { |
| 1327 | #[inline] |
| 1328 | fn nextrust-analyzer cargo oxiri 0.2.11 impl#[`ParserInput<'_>`]next().(&mut self) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<char> { |
| 1329 | if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(head) = self.valuerust-analyzer cargo oxiri 0.2.11 ParserInput#value..nextrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/iter/impl#[`Chars<'a>`][Iterator]next().() { |
| 1330 | self.positionrust-analyzer cargo oxiri 0.2.11 ParserInput#position. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().head.len_utf8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core char/methods/impl#[char]len_utf8().(); |
| 1331 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(head) |
| 1332 | } else { |
| 1333 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# |
| 1334 | } |
| 1335 | } |
| 1336 | |
| 1337 | #[inline] |
| 1338 | fn frontrust-analyzer cargo oxiri 0.2.11 impl#[`ParserInput<'_>`]front().(&self) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<char> { |
| 1339 | self.valuerust-analyzer cargo oxiri 0.2.11 ParserInput#value..clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/iter/impl#[`Chars<'a>`][Clone]clone().().nextrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/iter/impl#[`Chars<'a>`][Iterator]next().() |
| 1340 | } |
| 1341 | |
| 1342 | #[inline] |
| 1343 | fn starts_withrust-analyzer cargo oxiri 0.2.11 impl#[`ParserInput<'_>`]starts_with().(&self, c: char) -> bool { |
| 1344 | self.valuerust-analyzer cargo oxiri 0.2.11 ParserInput#value..as_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/iter/impl#[`Chars<'a>`]as_str().().starts_withrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]starts_with().(c) |
| 1345 | } |
| 1346 | } |
| 1347 | |
| 1348 | /// parser implementing https://url.spec.whatwg.org/#concept-basic-url-parser without the normalization or backward compatibility bits to comply with RFC 3987 |
| 1349 | /// |
| 1350 | /// A sub function takes care of each state |
| 1351 | struct IriParserrust-analyzer cargo oxiri 0.2.11 IriParser#<'a, O: OutputBufferrust-analyzer cargo oxiri 0.2.11 OutputBuffer#, const UNCHECKED: bool> { |
| 1352 | irirust-analyzer cargo oxiri 0.2.11 IriParser#iri.: &'a str, |
| 1353 | baserust-analyzer cargo oxiri 0.2.11 IriParser#base.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<&'a str>>, |
| 1354 | inputrust-analyzer cargo oxiri 0.2.11 IriParser#input.: ParserInputrust-analyzer cargo oxiri 0.2.11 ParserInput#<'a>, |
| 1355 | outputrust-analyzer cargo oxiri 0.2.11 IriParser#output.: &'a mut O, |
| 1356 | output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions.: IriElementsPositionsrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#, |
| 1357 | input_scheme_endrust-analyzer cargo oxiri 0.2.11 IriParser#input_scheme_end.: usize, |
| 1358 | } |
| 1359 | |
| 1360 | impl<'a, O: OutputBufferrust-analyzer cargo oxiri 0.2.11 OutputBuffer#, const UNCHECKED: bool> IriParserrust-analyzer cargo oxiri 0.2.11 IriParser#<'a, O, UNCHECKED> { |
| 1361 | fn parserust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse().( |
| 1362 | iri: &'a str, |
| 1363 | base: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<&'a str>>, |
| 1364 | output: &'a mut O, |
| 1365 | ) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<IriElementsPositionsrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#, IriParseErrorrust-analyzer cargo oxiri 0.2.11 IriParseError#> { |
| 1366 | let mut parser = Selfrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`] { |
| 1367 | irirust-analyzer cargo oxiri 0.2.11 IriParser#iri., |
| 1368 | baserust-analyzer cargo oxiri 0.2.11 IriParser#base., |
| 1369 | inputrust-analyzer cargo oxiri 0.2.11 IriParser#input.: ParserInputrust-analyzer cargo oxiri 0.2.11 ParserInput# { |
| 1370 | valuerust-analyzer cargo oxiri 0.2.11 ParserInput#value.: iri.charsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]chars().(), |
| 1371 | positionrust-analyzer cargo oxiri 0.2.11 ParserInput#position.: 0, |
| 1372 | }, |
| 1373 | outputrust-analyzer cargo oxiri 0.2.11 IriParser#output., |
| 1374 | output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions.: IriElementsPositionsrust-analyzer cargo oxiri 0.2.11 IriElementsPositions# { |
| 1375 | scheme_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#scheme_end.: 0, |
| 1376 | authority_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#authority_end.: 0, |
| 1377 | path_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#path_end.: 0, |
| 1378 | query_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#query_end.: 0, |
| 1379 | }, |
| 1380 | input_scheme_endrust-analyzer cargo oxiri 0.2.11 IriParser#input_scheme_end.: 0, |
| 1381 | }; |
| 1382 | parser.parse_scheme_startrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_scheme_start().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 1383 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(parser.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions.) |
| 1384 | } |
| 1385 | |
| 1386 | fn parse_scheme_startrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_scheme_start().(&mut self) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), IriParseErrorrust-analyzer cargo oxiri 0.2.11 IriParseError#> { |
| 1387 | match self.inputrust-analyzer cargo oxiri 0.2.11 IriParser#input..frontrust-analyzer cargo oxiri 0.2.11 impl#[`ParserInput<'_>`]front().() { |
| 1388 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(':') => { |
| 1389 | if UNCHECKED { |
| 1390 | self.parse_schemerust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_scheme().() |
| 1391 | } else { |
| 1392 | self.parse_errorrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_error().(IriParseErrorKindrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#::NoSchemerust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#NoScheme#) |
| 1393 | } |
| 1394 | } |
| 1395 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(c) if c.is_ascii_alphabeticrust-analyzer cargo core https://github.com/rust-lang/rust/library/core char/methods/impl#[char]is_ascii_alphabetic().() => self.parse_schemerust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_scheme().(), |
| 1396 | _ => self.parse_relativerust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_relative().(), |
| 1397 | } |
| 1398 | } |
| 1399 | |
| 1400 | fn parse_schemerust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_scheme().(&mut self) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), IriParseErrorrust-analyzer cargo oxiri 0.2.11 IriParseError#> { |
| 1401 | loop { |
| 1402 | let c = self.inputrust-analyzer cargo oxiri 0.2.11 IriParser#input..nextrust-analyzer cargo oxiri 0.2.11 impl#[`ParserInput<'_>`]next().(); |
| 1403 | match c { |
| 1404 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(c) if c.is_ascii_alphanumericrust-analyzer cargo core https://github.com/rust-lang/rust/library/core char/methods/impl#[char]is_ascii_alphanumeric().() || c rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq().'+' || c rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq().'-' || c rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq().'.' => { |
| 1405 | self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..pushrust-analyzer cargo oxiri 0.2.11 OutputBuffer#push().(c) |
| 1406 | } |
| 1407 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(':') => { |
| 1408 | self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..pushrust-analyzer cargo oxiri 0.2.11 OutputBuffer#push().(':'); |
| 1409 | self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..scheme_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#scheme_end. = self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..lenrust-analyzer cargo oxiri 0.2.11 OutputBuffer#len().(); |
| 1410 | self.input_scheme_endrust-analyzer cargo oxiri 0.2.11 IriParser#input_scheme_end. = self.inputrust-analyzer cargo oxiri 0.2.11 IriParser#input..positionrust-analyzer cargo oxiri 0.2.11 ParserInput#position.; |
| 1411 | return if self.inputrust-analyzer cargo oxiri 0.2.11 IriParser#input..starts_withrust-analyzer cargo oxiri 0.2.11 impl#[`ParserInput<'_>`]starts_with().('/') { |
| 1412 | self.inputrust-analyzer cargo oxiri 0.2.11 IriParser#input..nextrust-analyzer cargo oxiri 0.2.11 impl#[`ParserInput<'_>`]next().(); |
| 1413 | self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..pushrust-analyzer cargo oxiri 0.2.11 OutputBuffer#push().('/'); |
| 1414 | self.parse_path_or_authorityrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_path_or_authority().() |
| 1415 | } else { |
| 1416 | self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..authority_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#authority_end. = self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..lenrust-analyzer cargo oxiri 0.2.11 OutputBuffer#len().(); |
| 1417 | self.parse_pathrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_path().::<false>() |
| 1418 | }; |
| 1419 | } |
| 1420 | _ => { |
| 1421 | self.inputrust-analyzer cargo oxiri 0.2.11 IriParser#input. = ParserInputrust-analyzer cargo oxiri 0.2.11 ParserInput# { |
| 1422 | valuerust-analyzer cargo oxiri 0.2.11 ParserInput#value.: self.irirust-analyzer cargo oxiri 0.2.11 IriParser#iri..charsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]chars().(), |
| 1423 | positionrust-analyzer cargo oxiri 0.2.11 ParserInput#position.: 0, |
| 1424 | }; // reset |
| 1425 | self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..clearrust-analyzer cargo oxiri 0.2.11 OutputBuffer#clear().(); |
| 1426 | return self.parse_relativerust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_relative().(); |
| 1427 | } |
| 1428 | } |
| 1429 | } |
| 1430 | } |
| 1431 | |
| 1432 | fn parse_path_or_authorityrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_path_or_authority().(&mut self) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), IriParseErrorrust-analyzer cargo oxiri 0.2.11 IriParseError#> { |
| 1433 | if self.inputrust-analyzer cargo oxiri 0.2.11 IriParser#input..starts_withrust-analyzer cargo oxiri 0.2.11 impl#[`ParserInput<'_>`]starts_with().('/') { |
| 1434 | self.inputrust-analyzer cargo oxiri 0.2.11 IriParser#input..nextrust-analyzer cargo oxiri 0.2.11 impl#[`ParserInput<'_>`]next().(); |
| 1435 | self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..pushrust-analyzer cargo oxiri 0.2.11 OutputBuffer#push().('/'); |
| 1436 | self.parse_authorityrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_authority().() |
| 1437 | } else { |
| 1438 | self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..authority_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#authority_end. = self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..lenrust-analyzer cargo oxiri 0.2.11 OutputBuffer#len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().1; |
| 1439 | self.parse_pathrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_path().::<false>() |
| 1440 | } |
| 1441 | } |
| 1442 | |
| 1443 | fn parse_relativerust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_relative().(&mut self) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), IriParseErrorrust-analyzer cargo oxiri 0.2.11 IriParseError#> { |
| 1444 | if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(base) = self.baserust-analyzer cargo oxiri 0.2.11 IriParser#base. { |
| 1445 | match self.inputrust-analyzer cargo oxiri 0.2.11 IriParser#input..frontrust-analyzer cargo oxiri 0.2.11 impl#[`ParserInput<'_>`]front().() { |
| 1446 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# => { |
| 1447 | self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..push_strrust-analyzer cargo oxiri 0.2.11 OutputBuffer#push_str().(&base.irirust-analyzer cargo oxiri 0.2.11 IriRef#iri.[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/RangeTo#base.positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..query_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#query_end.]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().); |
| 1448 | self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..scheme_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#scheme_end. = base.positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..scheme_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#scheme_end.; |
| 1449 | self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..authority_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#authority_end. = base.positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..authority_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#authority_end.; |
| 1450 | self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..path_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#path_end. = base.positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..path_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#path_end.; |
| 1451 | self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..query_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#query_end. = base.positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..query_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#query_end.; |
| 1452 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()) |
| 1453 | } |
| 1454 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#('/') => { |
| 1455 | self.inputrust-analyzer cargo oxiri 0.2.11 IriParser#input..nextrust-analyzer cargo oxiri 0.2.11 impl#[`ParserInput<'_>`]next().(); |
| 1456 | self.parse_relative_slashrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_relative_slash().(&base) |
| 1457 | } |
| 1458 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#('?') => { |
| 1459 | self.inputrust-analyzer cargo oxiri 0.2.11 IriParser#input..nextrust-analyzer cargo oxiri 0.2.11 impl#[`ParserInput<'_>`]next().(); |
| 1460 | self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..push_strrust-analyzer cargo oxiri 0.2.11 OutputBuffer#push_str().(&base.irirust-analyzer cargo oxiri 0.2.11 IriRef#iri.[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/RangeTo#base.positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..path_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#path_end.]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().); |
| 1461 | self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..pushrust-analyzer cargo oxiri 0.2.11 OutputBuffer#push().('?'); |
| 1462 | self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..scheme_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#scheme_end. = base.positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..scheme_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#scheme_end.; |
| 1463 | self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..authority_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#authority_end. = base.positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..authority_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#authority_end.; |
| 1464 | self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..path_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#path_end. = base.positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..path_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#path_end.; |
| 1465 | self.parse_queryrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_query().() |
| 1466 | } |
| 1467 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#('#') => { |
| 1468 | self.inputrust-analyzer cargo oxiri 0.2.11 IriParser#input..nextrust-analyzer cargo oxiri 0.2.11 impl#[`ParserInput<'_>`]next().(); |
| 1469 | self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..push_strrust-analyzer cargo oxiri 0.2.11 OutputBuffer#push_str().(&base.irirust-analyzer cargo oxiri 0.2.11 IriRef#iri.[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/RangeTo#base.positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..query_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#query_end.]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().); |
| 1470 | self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..scheme_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#scheme_end. = base.positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..scheme_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#scheme_end.; |
| 1471 | self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..authority_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#authority_end. = base.positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..authority_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#authority_end.; |
| 1472 | self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..path_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#path_end. = base.positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..path_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#path_end.; |
| 1473 | self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..query_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#query_end. = base.positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..query_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#query_end.; |
| 1474 | self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..pushrust-analyzer cargo oxiri 0.2.11 OutputBuffer#push().('#'); |
| 1475 | self.parse_fragmentrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_fragment().() |
| 1476 | } |
| 1477 | _ => { |
| 1478 | self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..push_strrust-analyzer cargo oxiri 0.2.11 OutputBuffer#push_str().(&base.irirust-analyzer cargo oxiri 0.2.11 IriRef#iri.[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/RangeTo#base.positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..path_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#path_end.]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().); |
| 1479 | self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..scheme_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#scheme_end. = base.positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..scheme_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#scheme_end.; |
| 1480 | self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..authority_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#authority_end. = base.positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..authority_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#authority_end.; |
| 1481 | self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..path_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#path_end. = base.positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..path_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#path_end.; |
| 1482 | self.remove_last_segmentrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]remove_last_segment().(); |
| 1483 | self.parse_relative_pathrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_relative_path().::<true>() |
| 1484 | } |
| 1485 | } |
| 1486 | } else { |
| 1487 | self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..scheme_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#scheme_end. = 0; |
| 1488 | self.input_scheme_endrust-analyzer cargo oxiri 0.2.11 IriParser#input_scheme_end. = 0; |
| 1489 | if self.inputrust-analyzer cargo oxiri 0.2.11 IriParser#input..starts_withrust-analyzer cargo oxiri 0.2.11 impl#[`ParserInput<'_>`]starts_with().('/') { |
| 1490 | self.inputrust-analyzer cargo oxiri 0.2.11 IriParser#input..nextrust-analyzer cargo oxiri 0.2.11 impl#[`ParserInput<'_>`]next().(); |
| 1491 | self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..pushrust-analyzer cargo oxiri 0.2.11 OutputBuffer#push().('/'); |
| 1492 | self.parse_path_or_authorityrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_path_or_authority().() |
| 1493 | } else { |
| 1494 | self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..authority_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#authority_end. = 0; |
| 1495 | self.parse_relative_pathrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_relative_path().::<false>() |
| 1496 | } |
| 1497 | } |
| 1498 | } |
| 1499 | |
| 1500 | fn parse_relative_pathrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_relative_path().<const REMOVE_DOT_SEGMENTS: bool>( |
| 1501 | &mut self, |
| 1502 | ) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), IriParseErrorrust-analyzer cargo oxiri 0.2.11 IriParseError#> { |
| 1503 | while let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(c) = self.inputrust-analyzer cargo oxiri 0.2.11 IriParser#input..frontrust-analyzer cargo oxiri 0.2.11 impl#[`ParserInput<'_>`]front().() { |
| 1504 | if matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/matches!!(c, '/' | '?' | '#') { |
| 1505 | break; |
| 1506 | } |
| 1507 | self.inputrust-analyzer cargo oxiri 0.2.11 IriParser#input..nextrust-analyzer cargo oxiri 0.2.11 impl#[`ParserInput<'_>`]next().(); |
| 1508 | self.read_url_codepoint_or_echarrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]read_url_codepoint_or_echar().(c, |c| is_iunreserved_or_sub_delimsrust-analyzer cargo oxiri 0.2.11 is_iunreserved_or_sub_delims().(c) || c rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq().'@')?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 1509 | } |
| 1510 | self.parse_pathrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_path().::<REMOVE_DOT_SEGMENTS>() |
| 1511 | } |
| 1512 | |
| 1513 | fn parse_relative_slashrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_relative_slash().(&mut self, base: &IriRefrust-analyzer cargo oxiri 0.2.11 IriRef#<&'a str>) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), IriParseErrorrust-analyzer cargo oxiri 0.2.11 IriParseError#> { |
| 1514 | if self.inputrust-analyzer cargo oxiri 0.2.11 IriParser#input..starts_withrust-analyzer cargo oxiri 0.2.11 impl#[`ParserInput<'_>`]starts_with().('/') { |
| 1515 | self.inputrust-analyzer cargo oxiri 0.2.11 IriParser#input..nextrust-analyzer cargo oxiri 0.2.11 impl#[`ParserInput<'_>`]next().(); |
| 1516 | self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..push_strrust-analyzer cargo oxiri 0.2.11 OutputBuffer#push_str().(&base.irirust-analyzer cargo oxiri 0.2.11 IriRef#iri.[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/RangeTo#base.positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..scheme_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#scheme_end.]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().); |
| 1517 | self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..scheme_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#scheme_end. = base.positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..scheme_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#scheme_end.; |
| 1518 | self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..pushrust-analyzer cargo oxiri 0.2.11 OutputBuffer#push().('/'); |
| 1519 | self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..pushrust-analyzer cargo oxiri 0.2.11 OutputBuffer#push().('/'); |
| 1520 | self.parse_authorityrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_authority().() |
| 1521 | } else { |
| 1522 | self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output. |
| 1523 | .push_strrust-analyzer cargo oxiri 0.2.11 OutputBuffer#push_str().(&base.irirust-analyzer cargo oxiri 0.2.11 IriRef#iri.[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/RangeTo#base.positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..authority_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#authority_end.]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().); |
| 1524 | self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..pushrust-analyzer cargo oxiri 0.2.11 OutputBuffer#push().('/'); |
| 1525 | self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..scheme_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#scheme_end. = base.positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..scheme_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#scheme_end.; |
| 1526 | self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..authority_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#authority_end. = base.positionsrust-analyzer cargo oxiri 0.2.11 IriRef#positions..authority_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#authority_end.; |
| 1527 | self.parse_pathrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_path().::<true>() |
| 1528 | } |
| 1529 | } |
| 1530 | |
| 1531 | fn parse_authorityrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_authority().(&mut self) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), IriParseErrorrust-analyzer cargo oxiri 0.2.11 IriParseError#> { |
| 1532 | // @ are not allowed in IRI authorities so not need to take care of ambiguities |
| 1533 | loop { |
| 1534 | let c = self.inputrust-analyzer cargo oxiri 0.2.11 IriParser#input..nextrust-analyzer cargo oxiri 0.2.11 impl#[`ParserInput<'_>`]next().(); |
| 1535 | match c { |
| 1536 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#('@') => { |
| 1537 | self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..pushrust-analyzer cargo oxiri 0.2.11 OutputBuffer#push().('@'); |
| 1538 | return self.parse_hostrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_host().(); |
| 1539 | } |
| 1540 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#('[') | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#('/') | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#('?') | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#('#') => { |
| 1541 | self.inputrust-analyzer cargo oxiri 0.2.11 IriParser#input. = ParserInputrust-analyzer cargo oxiri 0.2.11 ParserInput# { |
| 1542 | valuerust-analyzer cargo oxiri 0.2.11 ParserInput#value.: self.irirust-analyzer cargo oxiri 0.2.11 IriParser#iri.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().self.input_scheme_endrust-analyzer cargo oxiri 0.2.11 IriParser#input_scheme_end. 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..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFrom#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()..charsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]chars().(), |
| 1543 | positionrust-analyzer cargo oxiri 0.2.11 ParserInput#position.: self.input_scheme_endrust-analyzer cargo oxiri 0.2.11 IriParser#input_scheme_end. 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, |
| 1544 | }; |
| 1545 | self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..truncaterust-analyzer cargo oxiri 0.2.11 OutputBuffer#truncate().(self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..scheme_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#scheme_end. 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); |
| 1546 | return self.parse_hostrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_host().(); |
| 1547 | } |
| 1548 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(c) => { |
| 1549 | self.read_url_codepoint_or_echarrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]read_url_codepoint_or_echar().(c, |c| { |
| 1550 | is_iunreserved_or_sub_delimsrust-analyzer cargo oxiri 0.2.11 is_iunreserved_or_sub_delims().(c) || c rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq().':' |
| 1551 | })?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 1552 | } |
| 1553 | } |
| 1554 | } |
| 1555 | } |
| 1556 | |
| 1557 | fn parse_hostrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_host().(&mut self) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), IriParseErrorrust-analyzer cargo oxiri 0.2.11 IriParseError#> { |
| 1558 | if self.inputrust-analyzer cargo oxiri 0.2.11 IriParser#input..starts_withrust-analyzer cargo oxiri 0.2.11 impl#[`ParserInput<'_>`]starts_with().('[') { |
| 1559 | // IP v6 |
| 1560 | let start_position = self.inputrust-analyzer cargo oxiri 0.2.11 IriParser#input..positionrust-analyzer cargo oxiri 0.2.11 ParserInput#position.; |
| 1561 | while let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(c) = self.inputrust-analyzer cargo oxiri 0.2.11 IriParser#input..nextrust-analyzer cargo oxiri 0.2.11 impl#[`ParserInput<'_>`]next().() { |
| 1562 | self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..pushrust-analyzer cargo oxiri 0.2.11 OutputBuffer#push().(c); |
| 1563 | if c rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq().']' { |
| 1564 | let ip = &self.irirust-analyzer cargo oxiri 0.2.11 IriParser#iri.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().start_position 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().1..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#self.inputrust-analyzer cargo oxiri 0.2.11 IriParser#input..positionrust-analyzer cargo oxiri 0.2.11 ParserInput#position. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().; |
| 1565 | if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().UNCHECKED { |
| 1566 | if ip.starts_withrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]starts_with().('v') || ip.starts_withrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]starts_with().('V') { |
| 1567 | self.validate_ip_v_futurerust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]validate_ip_v_future().(ip)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 1568 | } else if let Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(error) = Ipv6Addrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/ip_addr/Ipv6Addr#::from_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/parser/impl#[Ipv6Addr][FromStr]from_str().(ip) { |
| 1569 | return self.parse_errorrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_error().(IriParseErrorKindrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#::InvalidHostIprust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#InvalidHostIp#(error)); |
| 1570 | } |
| 1571 | } |
| 1572 | |
| 1573 | let c = self.inputrust-analyzer cargo oxiri 0.2.11 IriParser#input..nextrust-analyzer cargo oxiri 0.2.11 impl#[`ParserInput<'_>`]next().(); |
| 1574 | return match c { |
| 1575 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(':') => { |
| 1576 | self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..pushrust-analyzer cargo oxiri 0.2.11 OutputBuffer#push().(':'); |
| 1577 | self.parse_portrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_port().() |
| 1578 | } |
| 1579 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#('/') | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#('?') | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#('#') => { |
| 1580 | self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..authority_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#authority_end. = self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..lenrust-analyzer cargo oxiri 0.2.11 OutputBuffer#len().(); |
| 1581 | self.parse_path_startrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_path_start().(c) |
| 1582 | } |
| 1583 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(c) => { |
| 1584 | if UNCHECKED { |
| 1585 | self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..pushrust-analyzer cargo oxiri 0.2.11 OutputBuffer#push().(c); |
| 1586 | continue; |
| 1587 | } else { |
| 1588 | self.parse_errorrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_error().(IriParseErrorKindrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#::InvalidHostCharacterrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#InvalidHostCharacter#(c)) |
| 1589 | } |
| 1590 | } |
| 1591 | }; |
| 1592 | } |
| 1593 | } |
| 1594 | if UNCHECKED { |
| 1595 | // We consider it's valid even if it's not finished |
| 1596 | self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..authority_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#authority_end. = self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..lenrust-analyzer cargo oxiri 0.2.11 OutputBuffer#len().(); |
| 1597 | self.parse_path_startrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_path_start().(Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#) |
| 1598 | } else { |
| 1599 | self.parse_errorrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_error().(IriParseErrorKindrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#::InvalidHostCharacterrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#InvalidHostCharacter#('[')) |
| 1600 | } |
| 1601 | } else { |
| 1602 | // Other host |
| 1603 | loop { |
| 1604 | let c = self.inputrust-analyzer cargo oxiri 0.2.11 IriParser#input..nextrust-analyzer cargo oxiri 0.2.11 impl#[`ParserInput<'_>`]next().(); |
| 1605 | match c { |
| 1606 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(':') => { |
| 1607 | self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..pushrust-analyzer cargo oxiri 0.2.11 OutputBuffer#push().(':'); |
| 1608 | return self.parse_portrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_port().(); |
| 1609 | } |
| 1610 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#('/') | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#('?') | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#('#') => { |
| 1611 | self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..authority_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#authority_end. = self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..lenrust-analyzer cargo oxiri 0.2.11 OutputBuffer#len().(); |
| 1612 | return self.parse_path_startrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_path_start().(c); |
| 1613 | } |
| 1614 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(c) => self.read_url_codepoint_or_echarrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]read_url_codepoint_or_echar().(c, is_iunreserved_or_sub_delimsrust-analyzer cargo oxiri 0.2.11 is_iunreserved_or_sub_delims().)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()., |
| 1615 | } |
| 1616 | } |
| 1617 | } |
| 1618 | } |
| 1619 | |
| 1620 | fn parse_portrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_port().(&mut self) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), IriParseErrorrust-analyzer cargo oxiri 0.2.11 IriParseError#> { |
| 1621 | loop { |
| 1622 | let c = self.inputrust-analyzer cargo oxiri 0.2.11 IriParser#input..nextrust-analyzer cargo oxiri 0.2.11 impl#[`ParserInput<'_>`]next().(); |
| 1623 | match c { |
| 1624 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#('/') | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#('?') | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#('#') | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# => { |
| 1625 | self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..authority_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#authority_end. = self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..lenrust-analyzer cargo oxiri 0.2.11 OutputBuffer#len().(); |
| 1626 | return self.parse_path_startrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_path_start().(c); |
| 1627 | } |
| 1628 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(c) => { |
| 1629 | if UNCHECKED || c.is_ascii_digitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core char/methods/impl#[char]is_ascii_digit().() { |
| 1630 | self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..pushrust-analyzer cargo oxiri 0.2.11 OutputBuffer#push().(c) |
| 1631 | } else { |
| 1632 | return self.parse_errorrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_error().(IriParseErrorKindrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#::InvalidPortCharacterrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#InvalidPortCharacter#(c)); |
| 1633 | } |
| 1634 | } |
| 1635 | } |
| 1636 | } |
| 1637 | } |
| 1638 | |
| 1639 | fn parse_path_startrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_path_start().(&mut self, c: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<char>) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), IriParseErrorrust-analyzer cargo oxiri 0.2.11 IriParseError#> { |
| 1640 | match c { |
| 1641 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# => { |
| 1642 | self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..path_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#path_end. = self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..lenrust-analyzer cargo oxiri 0.2.11 OutputBuffer#len().(); |
| 1643 | self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..query_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#query_end. = self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..lenrust-analyzer cargo oxiri 0.2.11 OutputBuffer#len().(); |
| 1644 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()) |
| 1645 | } |
| 1646 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#('?') => { |
| 1647 | self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..path_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#path_end. = self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..lenrust-analyzer cargo oxiri 0.2.11 OutputBuffer#len().(); |
| 1648 | self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..pushrust-analyzer cargo oxiri 0.2.11 OutputBuffer#push().('?'); |
| 1649 | self.parse_queryrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_query().() |
| 1650 | } |
| 1651 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#('#') => { |
| 1652 | self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..path_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#path_end. = self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..lenrust-analyzer cargo oxiri 0.2.11 OutputBuffer#len().(); |
| 1653 | self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..query_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#query_end. = self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..lenrust-analyzer cargo oxiri 0.2.11 OutputBuffer#len().(); |
| 1654 | self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..pushrust-analyzer cargo oxiri 0.2.11 OutputBuffer#push().('#'); |
| 1655 | self.parse_fragmentrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_fragment().() |
| 1656 | } |
| 1657 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#('/') => { |
| 1658 | self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..pushrust-analyzer cargo oxiri 0.2.11 OutputBuffer#push().('/'); |
| 1659 | self.parse_pathrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_path().::<false>() |
| 1660 | } |
| 1661 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(c) => { |
| 1662 | self.read_url_codepoint_or_echarrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]read_url_codepoint_or_echar().(c, |c| { |
| 1663 | is_iunreserved_or_sub_delimsrust-analyzer cargo oxiri 0.2.11 is_iunreserved_or_sub_delims().(c) || matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/matches!!(c, ':' | '@') |
| 1664 | })?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 1665 | self.parse_pathrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_path().::<false>() |
| 1666 | } |
| 1667 | } |
| 1668 | } |
| 1669 | |
| 1670 | fn parse_pathrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_path().<const REMOVE_DOT_SEGMENTS: bool>(&mut self) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), IriParseErrorrust-analyzer cargo oxiri 0.2.11 IriParseError#> { |
| 1671 | loop { |
| 1672 | let c = self.inputrust-analyzer cargo oxiri 0.2.11 IriParser#input..nextrust-analyzer cargo oxiri 0.2.11 impl#[`ParserInput<'_>`]next().(); |
| 1673 | match c { |
| 1674 | Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#('/') | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#('?') | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#('#') => { |
| 1675 | let output_str = self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..as_strrust-analyzer cargo oxiri 0.2.11 OutputBuffer#as_str().(); |
| 1676 | if REMOVE_DOT_SEGMENTS { |
| 1677 | let output_path = &output_str[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..authority_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#authority_end...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFrom#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().; |
| 1678 | if output_path.ends_withrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]ends_with().("/..") { |
| 1679 | self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..truncaterust-analyzer cargo oxiri 0.2.11 OutputBuffer#truncate().(self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..lenrust-analyzer cargo oxiri 0.2.11 OutputBuffer#len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().3); |
| 1680 | self.remove_last_segmentrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]remove_last_segment().(); |
| 1681 | } else if output_path.ends_withrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]ends_with().("/.") || output_path 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()."." { |
| 1682 | self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..truncaterust-analyzer cargo oxiri 0.2.11 OutputBuffer#truncate().(self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..lenrust-analyzer cargo oxiri 0.2.11 OutputBuffer#len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().1); |
| 1683 | } else if output_path 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().".." { |
| 1684 | self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..truncaterust-analyzer cargo oxiri 0.2.11 OutputBuffer#truncate().(self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..lenrust-analyzer cargo oxiri 0.2.11 OutputBuffer#len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().2); |
| 1685 | } else if c 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().Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#('/') { |
| 1686 | self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..pushrust-analyzer cargo oxiri 0.2.11 OutputBuffer#push().('/'); |
| 1687 | continue; |
| 1688 | } |
| 1689 | } else if c 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().Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#('/') { |
| 1690 | self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..pushrust-analyzer cargo oxiri 0.2.11 OutputBuffer#push().('/'); |
| 1691 | continue; |
| 1692 | } |
| 1693 | |
| 1694 | // We validate that the path does not start with "//" and is ambiguous with an authority |
| 1695 | // It can happen after resolving ./ and ../ |
| 1696 | let output_str = self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..as_strrust-analyzer cargo oxiri 0.2.11 OutputBuffer#as_str().(); |
| 1697 | if REMOVE_DOT_SEGMENTS |
| 1698 | && !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().UNCHECKED |
| 1699 | && output_str[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..authority_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#authority_end...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFrom#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()..starts_withrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]starts_with().("//") |
| 1700 | && self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..authority_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#authority_end. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..scheme_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#scheme_end. |
| 1701 | { |
| 1702 | return self.parse_errorrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_error().(IriParseErrorKindrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#::PathStartingWithTwoSlashesrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#PathStartingWithTwoSlashes#); |
| 1703 | } |
| 1704 | |
| 1705 | if c 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().Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#('?') { |
| 1706 | self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..path_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#path_end. = self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..lenrust-analyzer cargo oxiri 0.2.11 OutputBuffer#len().(); |
| 1707 | self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..pushrust-analyzer cargo oxiri 0.2.11 OutputBuffer#push().('?'); |
| 1708 | return self.parse_queryrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_query().(); |
| 1709 | } else if c 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().Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#('#') { |
| 1710 | self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..path_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#path_end. = self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..lenrust-analyzer cargo oxiri 0.2.11 OutputBuffer#len().(); |
| 1711 | self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..query_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#query_end. = self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..lenrust-analyzer cargo oxiri 0.2.11 OutputBuffer#len().(); |
| 1712 | self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..pushrust-analyzer cargo oxiri 0.2.11 OutputBuffer#push().('#'); |
| 1713 | return self.parse_fragmentrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_fragment().(); |
| 1714 | } else if c.is_nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_none().() { |
| 1715 | self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..path_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#path_end. = self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..lenrust-analyzer cargo oxiri 0.2.11 OutputBuffer#len().(); |
| 1716 | self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..query_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#query_end. = self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..lenrust-analyzer cargo oxiri 0.2.11 OutputBuffer#len().(); |
| 1717 | return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()); |
| 1718 | } |
| 1719 | } |
| 1720 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(c) => self.read_url_codepoint_or_echarrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]read_url_codepoint_or_echar().(c, |c| { |
| 1721 | is_iunreserved_or_sub_delimsrust-analyzer cargo oxiri 0.2.11 is_iunreserved_or_sub_delims().(c) || matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/matches!!(c, ':' | '@') |
| 1722 | })?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()., |
| 1723 | } |
| 1724 | } |
| 1725 | } |
| 1726 | |
| 1727 | fn parse_queryrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_query().(&mut self) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), IriParseErrorrust-analyzer cargo oxiri 0.2.11 IriParseError#> { |
| 1728 | while let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(c) = self.inputrust-analyzer cargo oxiri 0.2.11 IriParser#input..nextrust-analyzer cargo oxiri 0.2.11 impl#[`ParserInput<'_>`]next().() { |
| 1729 | if c rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq().'#' { |
| 1730 | self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..query_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#query_end. = self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..lenrust-analyzer cargo oxiri 0.2.11 OutputBuffer#len().(); |
| 1731 | self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..pushrust-analyzer cargo oxiri 0.2.11 OutputBuffer#push().('#'); |
| 1732 | return self.parse_fragmentrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_fragment().(); |
| 1733 | } else { |
| 1734 | self.read_url_codepoint_or_echarrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]read_url_codepoint_or_echar().(c, |c| { |
| 1735 | is_iunreserved_or_sub_delimsrust-analyzer cargo oxiri 0.2.11 is_iunreserved_or_sub_delims().(c) || matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/matches!!(c, ':' | '@' | '/' | '?' | '\u{E000}'..='\u{F8FF}' | '\u{F0000}'..='\u{FFFFD}' | '\u{100000}'..='\u{10FFFD}') |
| 1736 | })?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). |
| 1737 | } |
| 1738 | } |
| 1739 | self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..query_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#query_end. = self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..lenrust-analyzer cargo oxiri 0.2.11 OutputBuffer#len().(); |
| 1740 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()) |
| 1741 | } |
| 1742 | |
| 1743 | fn parse_fragmentrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_fragment().(&mut self) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), IriParseErrorrust-analyzer cargo oxiri 0.2.11 IriParseError#> { |
| 1744 | while let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(c) = self.inputrust-analyzer cargo oxiri 0.2.11 IriParser#input..nextrust-analyzer cargo oxiri 0.2.11 impl#[`ParserInput<'_>`]next().() { |
| 1745 | self.read_url_codepoint_or_echarrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]read_url_codepoint_or_echar().(c, |c| { |
| 1746 | is_iunreserved_or_sub_delimsrust-analyzer cargo oxiri 0.2.11 is_iunreserved_or_sub_delims().(c) || matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/matches!!(c, ':' | '@' | '/' | '?') |
| 1747 | })?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 1748 | } |
| 1749 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()) |
| 1750 | } |
| 1751 | |
| 1752 | fn remove_last_segmentrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]remove_last_segment().(&mut self) { |
| 1753 | if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(last_slash_position) = |
| 1754 | self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..as_strrust-analyzer cargo oxiri 0.2.11 OutputBuffer#as_str().()[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..authority_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#authority_end...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFrom#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()..rfindrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]rfind().('/') |
| 1755 | { |
| 1756 | self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output. |
| 1757 | .truncaterust-analyzer cargo oxiri 0.2.11 OutputBuffer#truncate().(last_slash_position 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().self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..authority_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#authority_end.); |
| 1758 | self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..pushrust-analyzer cargo oxiri 0.2.11 OutputBuffer#push().('/'); |
| 1759 | } else { |
| 1760 | self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..truncaterust-analyzer cargo oxiri 0.2.11 OutputBuffer#truncate().(self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..authority_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#authority_end.); |
| 1761 | if self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..authority_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#authority_end. 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().self.output_positionsrust-analyzer cargo oxiri 0.2.11 IriParser#output_positions..scheme_endrust-analyzer cargo oxiri 0.2.11 IriElementsPositions#scheme_end. { |
| 1762 | self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..pushrust-analyzer cargo oxiri 0.2.11 OutputBuffer#push().('/'); |
| 1763 | } |
| 1764 | } |
| 1765 | } |
| 1766 | |
| 1767 | fn read_url_codepoint_or_echarrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]read_url_codepoint_or_echar().( |
| 1768 | &mut self, |
| 1769 | c: char, |
| 1770 | valid: impl Fnrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/function/Fn#(char) -> bool, |
| 1771 | ) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), IriParseErrorrust-analyzer cargo oxiri 0.2.11 IriParseError#> { |
| 1772 | if UNCHECKED || valid(c) { |
| 1773 | self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..pushrust-analyzer cargo oxiri 0.2.11 OutputBuffer#push().(c); |
| 1774 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()) |
| 1775 | } else if c rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq().'%' { |
| 1776 | self.read_echarrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]read_echar().() |
| 1777 | } else { |
| 1778 | self.parse_errorrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_error().(IriParseErrorKindrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#::InvalidIriCodePointrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#InvalidIriCodePoint#(c)) |
| 1779 | } |
| 1780 | } |
| 1781 | |
| 1782 | fn read_echarrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]read_echar().(&mut self) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), IriParseErrorrust-analyzer cargo oxiri 0.2.11 IriParseError#> { |
| 1783 | let c1 = self.inputrust-analyzer cargo oxiri 0.2.11 IriParser#input..nextrust-analyzer cargo oxiri 0.2.11 impl#[`ParserInput<'_>`]next().(); |
| 1784 | let c2 = self.inputrust-analyzer cargo oxiri 0.2.11 IriParser#input..nextrust-analyzer cargo oxiri 0.2.11 impl#[`ParserInput<'_>`]next().(); |
| 1785 | if c1.map_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]map_or().(false, |c| c.is_ascii_hexdigitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core char/methods/impl#[char]is_ascii_hexdigit().()) |
| 1786 | && c2.map_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]map_or().(false, |c| c.is_ascii_hexdigitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core char/methods/impl#[char]is_ascii_hexdigit().()) |
| 1787 | { |
| 1788 | self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..pushrust-analyzer cargo oxiri 0.2.11 OutputBuffer#push().('%'); |
| 1789 | self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..pushrust-analyzer cargo oxiri 0.2.11 OutputBuffer#push().(c1.unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().()); |
| 1790 | self.outputrust-analyzer cargo oxiri 0.2.11 IriParser#output..pushrust-analyzer cargo oxiri 0.2.11 OutputBuffer#push().(c2.unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().()); |
| 1791 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()) |
| 1792 | } else { |
| 1793 | self.parse_errorrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_error().(IriParseErrorKindrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#::InvalidPercentEncodingrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#InvalidPercentEncoding#([ |
| 1794 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#('%'), |
| 1795 | c1, |
| 1796 | c2, |
| 1797 | ])) |
| 1798 | } |
| 1799 | } |
| 1800 | |
| 1801 | fn parse_errorrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_error().<T>(&self, kind: IriParseErrorKindrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<T, IriParseErrorrust-analyzer cargo oxiri 0.2.11 IriParseError#> { |
| 1802 | Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(IriParseErrorrust-analyzer cargo oxiri 0.2.11 IriParseError# { kindrust-analyzer cargo oxiri 0.2.11 IriParseError#kind. }) |
| 1803 | } |
| 1804 | |
| 1805 | // IPvFuture = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" ) |
| 1806 | fn validate_ip_v_futurerust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]validate_ip_v_future().(&self, ip: &str) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), IriParseErrorrust-analyzer cargo oxiri 0.2.11 IriParseError#> { |
| 1807 | let mut chars = ip.charsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]chars().(); |
| 1808 | |
| 1809 | let c = chars.nextrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/iter/impl#[`Chars<'a>`][Iterator]next().().ok_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]ok_or().(IriParseErrorrust-analyzer cargo oxiri 0.2.11 IriParseError# { |
| 1810 | kindrust-analyzer cargo oxiri 0.2.11 IriParseError#kind.: IriParseErrorKindrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#::InvalidHostCharacterrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#InvalidHostCharacter#(']'), |
| 1811 | })?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 1812 | if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/matches!!(c, 'v' | 'V') { |
| 1813 | return self.parse_errorrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_error().(IriParseErrorKindrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#::InvalidHostCharacterrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#InvalidHostCharacter#(c)); |
| 1814 | }; |
| 1815 | |
| 1816 | let mut with_a_version = false; |
| 1817 | for c in &mut chars { |
| 1818 | if c rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq().'.' { |
| 1819 | break; |
| 1820 | } else if c.is_ascii_hexdigitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core char/methods/impl#[char]is_ascii_hexdigit().() { |
| 1821 | with_a_version = true; |
| 1822 | } else { |
| 1823 | return self.parse_errorrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_error().(IriParseErrorKindrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#::InvalidHostCharacterrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#InvalidHostCharacter#(c)); |
| 1824 | } |
| 1825 | } |
| 1826 | if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().with_a_version { |
| 1827 | return self.parse_errorrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_error().(IriParseErrorKindrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#::InvalidHostCharacterrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#InvalidHostCharacter#( |
| 1828 | chars.nextrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/iter/impl#[`Chars<'a>`][Iterator]next().().unwrap_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap_or().(']'), |
| 1829 | )); |
| 1830 | } |
| 1831 | |
| 1832 | if chars.as_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/iter/impl#[`Chars<'a>`]as_str().().is_emptyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]is_empty().() { |
| 1833 | return self.parse_errorrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_error().(IriParseErrorKindrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#::InvalidHostCharacterrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#InvalidHostCharacter#(']')); |
| 1834 | }; |
| 1835 | for c in chars { |
| 1836 | if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().is_unreserved_or_sub_delimsrust-analyzer cargo oxiri 0.2.11 is_unreserved_or_sub_delims().(c) && c rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]ne().':' { |
| 1837 | return self.parse_errorrust-analyzer cargo oxiri 0.2.11 impl#[`IriParser<'a, O, UNCHECKED>`]parse_error().(IriParseErrorKindrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#::InvalidHostCharacterrust-analyzer cargo oxiri 0.2.11 IriParseErrorKind#InvalidHostCharacter#(c)); |
| 1838 | } |
| 1839 | } |
| 1840 | |
| 1841 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()) |
| 1842 | } |
| 1843 | } |
| 1844 | |
| 1845 | fn is_iunreserved_or_sub_delimsrust-analyzer cargo oxiri 0.2.11 is_iunreserved_or_sub_delims().(c: char) -> bool { |
| 1846 | matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/matches!!(c, |
| 1847 | 'a'..='z' |
| 1848 | | 'A'..='Z' |
| 1849 | | '0'..='9' |
| 1850 | | '!' |
| 1851 | | '$' |
| 1852 | | '&' |
| 1853 | | '\'' |
| 1854 | | '(' |
| 1855 | | ')' |
| 1856 | | '*' |
| 1857 | | '+' |
| 1858 | | ',' |
| 1859 | | '-' |
| 1860 | | '.' |
| 1861 | | ';' |
| 1862 | | '=' |
| 1863 | | '_' |
| 1864 | | '~' |
| 1865 | | '\u{A0}'..='\u{D7FF}' |
| 1866 | | '\u{F900}'..='\u{FDCF}' |
| 1867 | | '\u{FDF0}'..='\u{FFEF}' |
| 1868 | | '\u{10000}'..='\u{1FFFD}' |
| 1869 | | '\u{20000}'..='\u{2FFFD}' |
| 1870 | | '\u{30000}'..='\u{3FFFD}' |
| 1871 | | '\u{40000}'..='\u{4FFFD}' |
| 1872 | | '\u{50000}'..='\u{5FFFD}' |
| 1873 | | '\u{60000}'..='\u{6FFFD}' |
| 1874 | | '\u{70000}'..='\u{7FFFD}' |
| 1875 | | '\u{80000}'..='\u{8FFFD}' |
| 1876 | | '\u{90000}'..='\u{9FFFD}' |
| 1877 | | '\u{A0000}'..='\u{AFFFD}' |
| 1878 | | '\u{B0000}'..='\u{BFFFD}' |
| 1879 | | '\u{C0000}'..='\u{CFFFD}' |
| 1880 | | '\u{D0000}'..='\u{DFFFD}' |
| 1881 | | '\u{E1000}'..='\u{EFFFD}' |
| 1882 | ) |
| 1883 | } |
| 1884 | |
| 1885 | fn is_unreserved_or_sub_delimsrust-analyzer cargo oxiri 0.2.11 is_unreserved_or_sub_delims().(c: char) -> bool { |
| 1886 | matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/matches!!(c, |
| 1887 | 'a'..='z' |
| 1888 | | 'A'..='Z' |
| 1889 | | '0'..='9' |
| 1890 | | '!' |
| 1891 | | '$' |
| 1892 | | '&' |
| 1893 | | '\'' |
| 1894 | | '(' |
| 1895 | | ')' |
| 1896 | | '*' |
| 1897 | | '+' |
| 1898 | | ',' |
| 1899 | | '-' |
| 1900 | | '.' |
| 1901 | | ';' |
| 1902 | | '=' |
| 1903 | | '_' |
| 1904 | | '~' |
| 1905 | ) |
| 1906 | } |