#[non_exhaustive]pub enum NameProblem {
Empty,
TooLong,
LeadingChar,
Character,
ReservedDevice,
}Expand description
Why a string is not a usable database name.
A typed reason rather than a message, so a caller (and a test) can react to the specific problem instead of matching on prose.
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 name was empty.
TooLong
The name was longer than MAX_DB_NAME.
LeadingChar
The first character was neither a lowercase ASCII letter nor a digit.
Leading -, _ and . are refused so a name can never be read as a
flag or as a relative path component.
Character
Some character was outside [a-z0-9_-].
ReservedDevice
The name is a Windows device name (con, nul, com1, …). Refused
everywhere so a workspace stays portable between machines.
Trait Implementations§
Source§impl Clone for NameProblem
impl Clone for NameProblem
Source§fn clone(&self) -> NameProblem
fn clone(&self) -> NameProblem
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 moreimpl Copy for NameProblem
Source§impl Debug for NameProblem
impl Debug for NameProblem
Source§impl Display for NameProblem
impl Display for NameProblem
impl Eq for NameProblem
Source§impl PartialEq for NameProblem
impl PartialEq for NameProblem
impl StructuralPartialEq for NameProblem
Auto Trait Implementations§
impl Freeze for NameProblem
impl RefUnwindSafe for NameProblem
impl Send for NameProblem
impl Sync for NameProblem
impl Unpin for NameProblem
impl UnsafeUnpin for NameProblem
impl UnwindSafe for NameProblem
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.