pub struct InvalidPackageName(/* private fields */);Expand description
A package name that failed a PackageNaming::validate_package_name lint.
This is not a construction-time gate — PackageName::new stays infallible — it
only carries why a name looks wrong so an LSP diagnostic can say something more
specific than “invalid name”.
§Examples
use deps_core::InvalidPackageName;
let err = InvalidPackageName::new("name is longer than 214 characters");
assert_eq!(err.reason(), "name is longer than 214 characters");
assert_eq!(err.to_string(), "name is longer than 214 characters");Implementations§
Trait Implementations§
Source§impl Clone for InvalidPackageName
impl Clone for InvalidPackageName
Source§fn clone(&self) -> InvalidPackageName
fn clone(&self) -> InvalidPackageName
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 InvalidPackageName
impl Debug for InvalidPackageName
Source§impl Display for InvalidPackageName
impl Display for InvalidPackageName
impl Eq for InvalidPackageName
Source§impl Error for InvalidPackageName
impl Error for InvalidPackageName
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 InvalidPackageName
impl PartialEq for InvalidPackageName
Source§fn eq(&self, other: &InvalidPackageName) -> bool
fn eq(&self, other: &InvalidPackageName) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for InvalidPackageName
Auto Trait Implementations§
impl Freeze for InvalidPackageName
impl RefUnwindSafe for InvalidPackageName
impl Send for InvalidPackageName
impl Sync for InvalidPackageName
impl Unpin for InvalidPackageName
impl UnsafeUnpin for InvalidPackageName
impl UnwindSafe for InvalidPackageName
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,
§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
Checks if this value is equivalent to the given key. Read more
§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
Checks if this value is equivalent to the given key. Read more
§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
Compare self to
key and return true if they are equal.