pub enum HandleError {
TooLong(usize),
TooFewSegments(usize),
EmptySegment,
SegmentTooLong(String),
InvalidCharacter(char),
HyphenEdge(String),
NumericTld(String),
PortOffLoopback(String),
}Expand description
Why a string is not a syntactically valid handle.
Variants§
TooLong(usize)
Over MAX_HANDLE_LENGTH characters.
TooFewSegments(usize)
Fewer than two segments: a bare com is not a handle.
EmptySegment
A segment was empty: a leading dot, a trailing dot, or a ...
SegmentTooLong(String)
A segment was over MAX_SEGMENT_LENGTH characters.
InvalidCharacter(char)
A character outside ASCII letters, digits, - and ..
HyphenEdge(String)
A segment started or ended with a hyphen.
NumericTld(String)
The last segment is the top-level domain, which may not start with a
digit. This is what keeps 127.0.0.1 from being a handle.
PortOffLoopback(String)
A port was supplied for a handle that is not a bare loopback name.
Never produced by validate, which answers about a string on its
own. It belongs here because atproto_did_url is the one place a
handle turns into something fetchable, and a port outside development
is the same mistake atproto refuses for a did:web.
Trait Implementations§
Source§impl Clone for HandleError
impl Clone for HandleError
Source§fn clone(&self) -> HandleError
fn clone(&self) -> HandleError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for HandleError
impl Debug for HandleError
Source§impl Display for HandleError
impl Display for HandleError
Source§impl Error for HandleError
impl Error for HandleError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl PartialEq for HandleError
impl PartialEq for HandleError
Source§fn eq(&self, other: &HandleError) -> bool
fn eq(&self, other: &HandleError) -> bool
self and other values to be equal, and is used by ==.impl Eq for HandleError
impl StructuralPartialEq for HandleError
Auto Trait Implementations§
impl Freeze for HandleError
impl RefUnwindSafe for HandleError
impl Send for HandleError
impl Sync for HandleError
impl Unpin for HandleError
impl UnsafeUnpin for HandleError
impl UnwindSafe for HandleError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.