pub struct PlanetName(/* private fields */);Implementations§
Source§impl PlanetName
impl PlanetName
Sourcepub fn new(value: impl AsRef<str>) -> Result<Self, PlanetTextError>
pub fn new(value: impl AsRef<str>) -> Result<Self, PlanetTextError>
Creates a planet name from non-empty text.
§Errors
Returns PlanetTextError::EmptyName when the trimmed input is empty.
pub fn as_str(&self) -> &str
pub fn into_string(self) -> String
Trait Implementations§
Source§impl AsRef<str> for PlanetName
impl AsRef<str> for PlanetName
Source§impl Clone for PlanetName
impl Clone for PlanetName
Source§fn clone(&self) -> PlanetName
fn clone(&self) -> PlanetName
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 PlanetName
impl Debug for PlanetName
Source§impl Display for PlanetName
impl Display for PlanetName
Source§impl FromStr for PlanetName
impl FromStr for PlanetName
Source§impl Hash for PlanetName
impl Hash for PlanetName
Source§impl Ord for PlanetName
impl Ord for PlanetName
Source§fn cmp(&self, other: &PlanetName) -> Ordering
fn cmp(&self, other: &PlanetName) -> Ordering
1.21.0 (const: unstable) · 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 PlanetName
impl PartialEq for PlanetName
Source§fn eq(&self, other: &PlanetName) -> bool
fn eq(&self, other: &PlanetName) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for PlanetName
impl PartialOrd for PlanetName
impl Eq for PlanetName
impl StructuralPartialEq for PlanetName
Auto Trait Implementations§
impl Freeze for PlanetName
impl RefUnwindSafe for PlanetName
impl Send for PlanetName
impl Sync for PlanetName
impl Unpin for PlanetName
impl UnsafeUnpin for PlanetName
impl UnwindSafe for PlanetName
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