pub struct InvalidKey {
pub path: String,
pub type_name: String,
}Expand description
Why a value cannot be a Map key or Set element.
Fields§
§path: StringHow the offending part is reached from the value that was tested,
such as Point.tags or Point.tags[0]. Empty when the value itself,
not something nested inside it, is the problem.
type_name: StringThe type that cannot be a key.
Implementations§
Source§impl InvalidKey
impl InvalidKey
Sourcepub fn rule(&self) -> &'static str
pub fn rule(&self) -> &'static str
The rule this violation breaks.
Float is excluded for a reason distinct from every other rejection:
NaN != NaN breaks the total order a key needs, which has nothing to
do with mutability. Stating that separately keeps anyone from later
“fixing” Float as if it were just another mutable-handle case.
Trait Implementations§
Source§impl Clone for InvalidKey
impl Clone for InvalidKey
Source§fn clone(&self) -> InvalidKey
fn clone(&self) -> InvalidKey
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 InvalidKey
impl Debug for InvalidKey
impl Eq for InvalidKey
Source§impl PartialEq for InvalidKey
impl PartialEq for InvalidKey
Source§fn eq(&self, other: &InvalidKey) -> bool
fn eq(&self, other: &InvalidKey) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for InvalidKey
Auto Trait Implementations§
impl Freeze for InvalidKey
impl RefUnwindSafe for InvalidKey
impl Send for InvalidKey
impl Sync for InvalidKey
impl Unpin for InvalidKey
impl UnsafeUnpin for InvalidKey
impl UnwindSafe for InvalidKey
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
Compare self to
key and return true if they are equal.