| 1 | #![allow(missing_debug_implementations)] |
| 2 | |
| 3 | //! Percent-encoders for URI/IRI components. |
| 4 | |
| 5 | use superrust-analyzer cargo fluent-uri 0.4.1 pct_enc/::{tablerust-analyzer cargo fluent-uri 0.4.1 pct_enc/table/::*, Encoderrust-analyzer cargo fluent-uri 0.4.1 pct_enc/Encoder#, Tablerust-analyzer cargo fluent-uri 0.4.1 pct_enc/table/Table#}; |
| 6 | |
| 7 | /// An encoder for URI userinfo. |
| 8 | #[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:)] |
| 9 | pub struct Userinforust-analyzer cargo fluent-uri 0.4.1 pct_enc/encoder/Userinfo#(()); |
| 10 | |
| 11 | impl Encoderrust-analyzer cargo fluent-uri 0.4.1 pct_enc/Encoder# for Userinforust-analyzer cargo fluent-uri 0.4.1 pct_enc/encoder/Userinfo# { |
| 12 | const TABLErust-analyzer cargo fluent-uri 0.4.1 pct_enc/encoder/impl#[Userinfo][Encoder]TABLE.: &'static Tablerust-analyzer cargo fluent-uri 0.4.1 pct_enc/table/Table# = USERINFOrust-analyzer cargo fluent-uri 0.4.1 pct_enc/table/USERINFO.; |
| 13 | } |
| 14 | |
| 15 | /// An encoder for IRI userinfo. |
| 16 | #[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:)] |
| 17 | pub struct IUserinforust-analyzer cargo fluent-uri 0.4.1 pct_enc/encoder/IUserinfo#(()); |
| 18 | |
| 19 | impl Encoderrust-analyzer cargo fluent-uri 0.4.1 pct_enc/Encoder# for IUserinforust-analyzer cargo fluent-uri 0.4.1 pct_enc/encoder/IUserinfo# { |
| 20 | const TABLErust-analyzer cargo fluent-uri 0.4.1 pct_enc/encoder/impl#[IUserinfo][Encoder]TABLE.: &'static Tablerust-analyzer cargo fluent-uri 0.4.1 pct_enc/table/Table# = IUSERINFOrust-analyzer cargo fluent-uri 0.4.1 pct_enc/table/IUSERINFO.; |
| 21 | } |
| 22 | |
| 23 | /// An encoder for URI registered name. |
| 24 | #[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:)] |
| 25 | #[cfg_attr(fuzzing, derive(PartialEq, Eq))] |
| 26 | pub struct RegNamerust-analyzer cargo fluent-uri 0.4.1 pct_enc/encoder/RegName#(()); |
| 27 | |
| 28 | impl Encoderrust-analyzer cargo fluent-uri 0.4.1 pct_enc/Encoder# for RegNamerust-analyzer cargo fluent-uri 0.4.1 pct_enc/encoder/RegName# { |
| 29 | const TABLErust-analyzer cargo fluent-uri 0.4.1 pct_enc/encoder/impl#[RegName][Encoder]TABLE.: &'static Tablerust-analyzer cargo fluent-uri 0.4.1 pct_enc/table/Table# = REG_NAMErust-analyzer cargo fluent-uri 0.4.1 pct_enc/table/REG_NAME.; |
| 30 | } |
| 31 | |
| 32 | /// An encoder for IRI registered name. |
| 33 | #[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:)] |
| 34 | pub struct IRegNamerust-analyzer cargo fluent-uri 0.4.1 pct_enc/encoder/IRegName#(()); |
| 35 | |
| 36 | impl Encoderrust-analyzer cargo fluent-uri 0.4.1 pct_enc/Encoder# for IRegNamerust-analyzer cargo fluent-uri 0.4.1 pct_enc/encoder/IRegName# { |
| 37 | const TABLErust-analyzer cargo fluent-uri 0.4.1 pct_enc/encoder/impl#[IRegName][Encoder]TABLE.: &'static Tablerust-analyzer cargo fluent-uri 0.4.1 pct_enc/table/Table# = IREG_NAMErust-analyzer cargo fluent-uri 0.4.1 pct_enc/table/IREG_NAME.; |
| 38 | } |
| 39 | |
| 40 | /// An encoder for URI/IRI port. |
| 41 | #[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:)] |
| 42 | pub struct Portrust-analyzer cargo fluent-uri 0.4.1 pct_enc/encoder/Port#(()); |
| 43 | |
| 44 | impl Encoderrust-analyzer cargo fluent-uri 0.4.1 pct_enc/Encoder# for Portrust-analyzer cargo fluent-uri 0.4.1 pct_enc/encoder/Port# { |
| 45 | const TABLErust-analyzer cargo fluent-uri 0.4.1 pct_enc/encoder/impl#[Port][Encoder]TABLE.: &'static Tablerust-analyzer cargo fluent-uri 0.4.1 pct_enc/table/Table# = DIGITrust-analyzer cargo fluent-uri 0.4.1 pct_enc/table/DIGIT.; |
| 46 | } |
| 47 | |
| 48 | /// An encoder for URI path. |
| 49 | /// |
| 50 | /// `EStr` has [extension methods] for the path component. |
| 51 | /// |
| 52 | /// [extension methods]: super::EStr#impl-EStr<E>-1 |
| 53 | #[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:)] |
| 54 | pub struct Pathrust-analyzer cargo fluent-uri 0.4.1 pct_enc/encoder/Path#(()); |
| 55 | |
| 56 | impl Encoderrust-analyzer cargo fluent-uri 0.4.1 pct_enc/Encoder# for Pathrust-analyzer cargo fluent-uri 0.4.1 pct_enc/encoder/Path# { |
| 57 | const TABLErust-analyzer cargo fluent-uri 0.4.1 pct_enc/encoder/impl#[Path][Encoder]TABLE.: &'static Tablerust-analyzer cargo fluent-uri 0.4.1 pct_enc/table/Table# = PATHrust-analyzer cargo fluent-uri 0.4.1 pct_enc/table/PATH.; |
| 58 | } |
| 59 | |
| 60 | /// An encoder for IRI path. |
| 61 | /// |
| 62 | /// `EStr` has [extension methods] for the path component. |
| 63 | /// |
| 64 | /// [extension methods]: super::EStr#impl-EStr<E>-1 |
| 65 | #[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:)] |
| 66 | pub struct IPathrust-analyzer cargo fluent-uri 0.4.1 pct_enc/encoder/IPath#(()); |
| 67 | |
| 68 | impl Encoderrust-analyzer cargo fluent-uri 0.4.1 pct_enc/Encoder# for IPathrust-analyzer cargo fluent-uri 0.4.1 pct_enc/encoder/IPath# { |
| 69 | const TABLErust-analyzer cargo fluent-uri 0.4.1 pct_enc/encoder/impl#[IPath][Encoder]TABLE.: &'static Tablerust-analyzer cargo fluent-uri 0.4.1 pct_enc/table/Table# = IPATHrust-analyzer cargo fluent-uri 0.4.1 pct_enc/table/IPATH.; |
| 70 | } |
| 71 | |
| 72 | /// An encoder for URI query. |
| 73 | #[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:)] |
| 74 | pub struct Queryrust-analyzer cargo fluent-uri 0.4.1 pct_enc/encoder/Query#(()); |
| 75 | |
| 76 | impl Encoderrust-analyzer cargo fluent-uri 0.4.1 pct_enc/Encoder# for Queryrust-analyzer cargo fluent-uri 0.4.1 pct_enc/encoder/Query# { |
| 77 | const TABLErust-analyzer cargo fluent-uri 0.4.1 pct_enc/encoder/impl#[Query][Encoder]TABLE.: &'static Tablerust-analyzer cargo fluent-uri 0.4.1 pct_enc/table/Table# = QUERYrust-analyzer cargo fluent-uri 0.4.1 pct_enc/table/QUERY.; |
| 78 | } |
| 79 | |
| 80 | /// An encoder for IRI query. |
| 81 | #[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:)] |
| 82 | pub struct IQueryrust-analyzer cargo fluent-uri 0.4.1 pct_enc/encoder/IQuery#(()); |
| 83 | |
| 84 | impl Encoderrust-analyzer cargo fluent-uri 0.4.1 pct_enc/Encoder# for IQueryrust-analyzer cargo fluent-uri 0.4.1 pct_enc/encoder/IQuery# { |
| 85 | const TABLErust-analyzer cargo fluent-uri 0.4.1 pct_enc/encoder/impl#[IQuery][Encoder]TABLE.: &'static Tablerust-analyzer cargo fluent-uri 0.4.1 pct_enc/table/Table# = IQUERYrust-analyzer cargo fluent-uri 0.4.1 pct_enc/table/IQUERY.; |
| 86 | } |
| 87 | |
| 88 | /// An encoder for URI fragment. |
| 89 | #[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:)] |
| 90 | pub struct Fragmentrust-analyzer cargo fluent-uri 0.4.1 pct_enc/encoder/Fragment#(()); |
| 91 | |
| 92 | impl Encoderrust-analyzer cargo fluent-uri 0.4.1 pct_enc/Encoder# for Fragmentrust-analyzer cargo fluent-uri 0.4.1 pct_enc/encoder/Fragment# { |
| 93 | const TABLErust-analyzer cargo fluent-uri 0.4.1 pct_enc/encoder/impl#[Fragment][Encoder]TABLE.: &'static Tablerust-analyzer cargo fluent-uri 0.4.1 pct_enc/table/Table# = FRAGMENTrust-analyzer cargo fluent-uri 0.4.1 pct_enc/table/FRAGMENT.; |
| 94 | } |
| 95 | |
| 96 | /// An encoder for IRI fragment. |
| 97 | #[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:)] |
| 98 | pub struct IFragmentrust-analyzer cargo fluent-uri 0.4.1 pct_enc/encoder/IFragment#(()); |
| 99 | |
| 100 | impl Encoderrust-analyzer cargo fluent-uri 0.4.1 pct_enc/Encoder# for IFragmentrust-analyzer cargo fluent-uri 0.4.1 pct_enc/encoder/IFragment# { |
| 101 | const TABLErust-analyzer cargo fluent-uri 0.4.1 pct_enc/encoder/impl#[IFragment][Encoder]TABLE.: &'static Tablerust-analyzer cargo fluent-uri 0.4.1 pct_enc/table/Table# = IFRAGMENTrust-analyzer cargo fluent-uri 0.4.1 pct_enc/table/IFRAGMENT.; |
| 102 | } |
| 103 | |
| 104 | /// An encoder for URI data which preserves only [unreserved] characters |
| 105 | /// and encodes the others. |
| 106 | /// |
| 107 | /// [unreserved]: https://datatracker.ietf.org/doc/html/rfc3986#section-2.3 |
| 108 | #[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:)] |
| 109 | pub struct Datarust-analyzer cargo fluent-uri 0.4.1 pct_enc/encoder/Data#(()); |
| 110 | |
| 111 | impl Encoderrust-analyzer cargo fluent-uri 0.4.1 pct_enc/Encoder# for Datarust-analyzer cargo fluent-uri 0.4.1 pct_enc/encoder/Data# { |
| 112 | const TABLErust-analyzer cargo fluent-uri 0.4.1 pct_enc/encoder/impl#[Data][Encoder]TABLE.: &'static Tablerust-analyzer cargo fluent-uri 0.4.1 pct_enc/table/Table# = &UNRESERVEDrust-analyzer cargo fluent-uri 0.4.1 pct_enc/table/UNRESERVED..or_pct_encodedrust-analyzer cargo fluent-uri 0.4.1 pct_enc/table/impl#[Table]or_pct_encoded().(); |
| 113 | } |
| 114 | |
| 115 | /// An encoder for IRI data which preserves only [unreserved] characters |
| 116 | /// and encodes the others. |
| 117 | /// |
| 118 | /// [unreserved]: https://datatracker.ietf.org/doc/html/rfc3987#section-2.1 |
| 119 | #[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:)] |
| 120 | pub struct IDatarust-analyzer cargo fluent-uri 0.4.1 pct_enc/encoder/IData#(()); |
| 121 | |
| 122 | impl Encoderrust-analyzer cargo fluent-uri 0.4.1 pct_enc/Encoder# for IDatarust-analyzer cargo fluent-uri 0.4.1 pct_enc/encoder/IData# { |
| 123 | const TABLErust-analyzer cargo fluent-uri 0.4.1 pct_enc/encoder/impl#[IData][Encoder]TABLE.: &'static Tablerust-analyzer cargo fluent-uri 0.4.1 pct_enc/table/Table# = &UNRESERVEDrust-analyzer cargo fluent-uri 0.4.1 pct_enc/table/UNRESERVED..or_pct_encodedrust-analyzer cargo fluent-uri 0.4.1 pct_enc/table/impl#[Table]or_pct_encoded().().or_ucscharrust-analyzer cargo fluent-uri 0.4.1 pct_enc/table/impl#[Table]or_ucschar().(); |
| 124 | } |