pub enum IdValidationError {
InvalidFormat {
kind: &'static str,
value: String,
expected: &'static str,
},
WrongPrefix {
kind: &'static str,
expected: &'static str,
},
}Expand description
Error returned when a typed identifier fails parse-time validation.
Every RunId, NodeId, DiscussionId, and ProposalId is
constructed only through its parse_str constructor (or the equivalent
validating Deserialize), so any value that reaches a path helper has
already been checked for prefix, charset, and length. This is the
path-traversal guard: a raw id containing /, .., or a leading dot can
never be turned into one of these newtypes, so it can never name a file
outside the run directory.
Variants§
InvalidFormat
The value carried the right prefix (or needs none) but its body had the wrong length or used characters outside the permitted charset.
Fields
WrongPrefix
The value did not start with the id type’s required prefix
(n-, d-, s-).
Implementations§
Trait Implementations§
Source§impl Clone for IdValidationError
impl Clone for IdValidationError
Source§fn clone(&self) -> IdValidationError
fn clone(&self) -> IdValidationError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for IdValidationError
impl Debug for IdValidationError
Source§impl Display for IdValidationError
impl Display for IdValidationError
impl Eq for IdValidationError
Source§impl Error for IdValidationError
impl Error for IdValidationError
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 PartialEq for IdValidationError
impl PartialEq for IdValidationError
impl StructuralPartialEq for IdValidationError
Auto Trait Implementations§
impl Freeze for IdValidationError
impl RefUnwindSafe for IdValidationError
impl Send for IdValidationError
impl Sync for IdValidationError
impl Unpin for IdValidationError
impl UnsafeUnpin for IdValidationError
impl UnwindSafe for IdValidationError
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