pub struct InvalidTextField {
pub field: TextField,
pub reason: InvalidBoundedText,
}Expand description
Why a client-supplied text field was rejected, and which one.
§Examples
use mcpls_core::bridge::{NewName, TextField};
use mcpls_core::config::InvalidBoundedText;
let error = NewName::new(" ").unwrap_err();
assert_eq!(error.field, TextField::NewName);
assert_eq!(error.reason, InvalidBoundedText::Blank);
assert_eq!(error.to_string(), "`new_name` cannot be empty");Fields§
§field: TextFieldThe field that was rejected.
reason: InvalidBoundedTextThe rule it broke.
Trait Implementations§
Source§impl Clone for InvalidTextField
impl Clone for InvalidTextField
impl Copy for InvalidTextField
Source§impl Debug for InvalidTextField
impl Debug for InvalidTextField
Source§impl Display for InvalidTextField
impl Display for InvalidTextField
impl Eq for InvalidTextField
Source§impl Error for InvalidTextField
impl Error for InvalidTextField
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 InvalidTextField
impl PartialEq for InvalidTextField
impl StructuralPartialEq for InvalidTextField
Auto Trait Implementations§
impl Freeze for InvalidTextField
impl RefUnwindSafe for InvalidTextField
impl Send for InvalidTextField
impl Sync for InvalidTextField
impl Unpin for InvalidTextField
impl UnsafeUnpin for InvalidTextField
impl UnwindSafe for InvalidTextField
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.