#[non_exhaustive]pub enum InvalidTag {
Empty,
TooLong {
len: usize,
},
ControlCharacter,
BidirectionalControl,
ColonInKey,
}Expand description
A Tag failed validation.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Empty
The tag, or one half of a key:value pair, was empty.
TooLong
The tag exceeded MAX_TAG_LEN bytes.
ControlCharacter
The tag contained a control character (Unicode Cc).
BidirectionalControl
The tag contained one of the nine explicit bidirectional formatting controls: U+202A–U+202E or U+2066–U+2069.
Separate from ControlCharacter because the
two refusals have different remedies. A control character in an
identifier is almost always an encoding bug; a bidirectional override is
almost always an attack — a tag that renders as one thing in every
console and matches another in every query.
ColonInKey
The key half of a key:value pair itself contained a colon, which would
make Tag::key ambiguous.
Trait Implementations§
Source§impl Clone for InvalidTag
impl Clone for InvalidTag
Source§impl Debug for InvalidTag
impl Debug for InvalidTag
Source§impl Display for InvalidTag
impl Display for InvalidTag
impl Eq for InvalidTag
Source§impl Error for InvalidTag
impl Error for InvalidTag
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<InvalidTag> for InvalidQuery
impl From<InvalidTag> for InvalidQuery
Source§fn from(source: InvalidTag) -> Self
fn from(source: InvalidTag) -> Self
Converts to this type from the input type.
Source§impl PartialEq for InvalidTag
impl PartialEq for InvalidTag
impl StructuralPartialEq for InvalidTag
Auto Trait Implementations§
impl Freeze for InvalidTag
impl RefUnwindSafe for InvalidTag
impl Send for InvalidTag
impl Sync for InvalidTag
impl Unpin for InvalidTag
impl UnsafeUnpin for InvalidTag
impl UnwindSafe for InvalidTag
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more