pub enum CenterError {
ZeroWidthPadding,
}
Expand description
Error returned when failing to construct a Center
iterator.
This error is returned from String::center
. See its documentation for
more detail.
This error corresponds to the Ruby ArgumentError
Exception class.
When the std feature of spinoso-string
is enabled, this struct
implements std::error::Error
.
Variants§
ZeroWidthPadding
Error returned when calling String::center
with an empty padding
byte string.
Implementations§
Source§impl CenterError
impl CenterError
pub const EXCEPTION_TYPE: &'static str = "ArgumentError"
Sourcepub const fn zero_width_padding() -> Self
pub const fn zero_width_padding() -> Self
Create a new zero width padding CenterError
.
§Examples
use spinoso_string::CenterError;
const ERR: CenterError = CenterError::zero_width_padding();
assert_eq!(ERR.message(), "zero width padding");
Trait Implementations§
Source§impl Clone for CenterError
impl Clone for CenterError
Source§fn clone(&self) -> CenterError
fn clone(&self) -> CenterError
Returns a copy of the value. Read more
1.0.0 · 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 CenterError
impl Debug for CenterError
Source§impl Display for CenterError
impl Display for CenterError
Source§impl Error for CenterError
impl Error for CenterError
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 Hash for CenterError
impl Hash for CenterError
Source§impl Ord for CenterError
impl Ord for CenterError
Source§fn cmp(&self, other: &CenterError) -> Ordering
fn cmp(&self, other: &CenterError) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for CenterError
impl PartialEq for CenterError
Source§impl PartialOrd for CenterError
impl PartialOrd for CenterError
impl Copy for CenterError
impl Eq for CenterError
impl StructuralPartialEq for CenterError
Auto Trait Implementations§
impl Freeze for CenterError
impl RefUnwindSafe for CenterError
impl Send for CenterError
impl Sync for CenterError
impl Unpin for CenterError
impl UnwindSafe for CenterError
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