Struct ObservationSource
pub struct ObservationSource(/* private fields */);Expand description
A descriptive non-empty observation source label.
Implementations§
§impl ObservationSource
impl ObservationSource
pub fn new(
value: impl AsRef<str>,
) -> Result<ObservationSource, WeatherObservationError>
pub fn new( value: impl AsRef<str>, ) -> Result<ObservationSource, WeatherObservationError>
Creates an observation source label from non-empty text.
§Errors
Returns WeatherObservationError::EmptyObservationSource when the source is empty.
pub fn into_string(self) -> String
pub fn into_string(self) -> String
Consumes the source and returns the owned string.
Trait Implementations§
§impl AsRef<str> for ObservationSource
impl AsRef<str> for ObservationSource
§impl Clone for ObservationSource
impl Clone for ObservationSource
§fn clone(&self) -> ObservationSource
fn clone(&self) -> ObservationSource
Returns a duplicate 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 more§impl Debug for ObservationSource
impl Debug for ObservationSource
§impl Display for ObservationSource
impl Display for ObservationSource
§impl FromStr for ObservationSource
impl FromStr for ObservationSource
§type Err = WeatherObservationError
type Err = WeatherObservationError
The associated error which can be returned from parsing.
§fn from_str(
value: &str,
) -> Result<ObservationSource, <ObservationSource as FromStr>::Err>
fn from_str( value: &str, ) -> Result<ObservationSource, <ObservationSource as FromStr>::Err>
Parses a string
s to return a value of this type. Read more§impl Hash for ObservationSource
impl Hash for ObservationSource
§impl Ord for ObservationSource
impl Ord for ObservationSource
§fn cmp(&self, other: &ObservationSource) -> Ordering
fn cmp(&self, other: &ObservationSource) -> 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
§impl PartialEq for ObservationSource
impl PartialEq for ObservationSource
§impl PartialOrd for ObservationSource
impl PartialOrd for ObservationSource
impl Eq for ObservationSource
impl StructuralPartialEq for ObservationSource
Auto Trait Implementations§
impl Freeze for ObservationSource
impl RefUnwindSafe for ObservationSource
impl Send for ObservationSource
impl Sync for ObservationSource
impl Unpin for ObservationSource
impl UnsafeUnpin for ObservationSource
impl UnwindSafe for ObservationSource
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