#[non_exhaustive]pub enum WeatherError {
PermissionDenied,
Unknown(String),
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Implementations§
Source§impl WeatherError
impl WeatherError
pub fn raw_value(&self) -> &str
Sourcepub fn descriptors() -> Result<Vec<WeatherErrorDescriptor>, WeatherKitError>
pub fn descriptors() -> Result<Vec<WeatherErrorDescriptor>, WeatherKitError>
Examples found in repository?
examples/16_weather_enum_catalog.rs (line 32)
8fn main() -> Result<(), Box<dyn Error>> {
9 println!(
10 "precipitation={:?}",
11 Precipitation::descriptors()?
12 .iter()
13 .map(|descriptor| descriptor.raw_value.as_str())
14 .collect::<Vec<_>>()
15 );
16 println!(
17 "wind_compass={:?}",
18 WindCompassDirection::descriptors()?
19 .iter()
20 .map(|descriptor| descriptor.raw_value.as_str())
21 .collect::<Vec<_>>()
22 );
23 println!(
24 "uv_exposure={:?}",
25 UVExposureCategory::descriptors()?
26 .iter()
27 .map(|descriptor| descriptor.raw_value.as_str())
28 .collect::<Vec<_>>()
29 );
30 println!(
31 "weather_errors={:?}",
32 WeatherError::descriptors()?
33 .iter()
34 .map(|descriptor| descriptor.raw_value.as_str())
35 .collect::<Vec<_>>()
36 );
37
38 support::finish("weather enum catalog");
39 Ok(())
40}Trait Implementations§
Source§impl Clone for WeatherError
impl Clone for WeatherError
Source§fn clone(&self) -> WeatherError
fn clone(&self) -> WeatherError
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 WeatherError
impl Debug for WeatherError
Source§impl PartialEq for WeatherError
impl PartialEq for WeatherError
Source§fn eq(&self, other: &WeatherError) -> bool
fn eq(&self, other: &WeatherError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for WeatherError
impl StructuralPartialEq for WeatherError
Auto Trait Implementations§
impl Freeze for WeatherError
impl RefUnwindSafe for WeatherError
impl Send for WeatherError
impl Sync for WeatherError
impl Unpin for WeatherError
impl UnsafeUnpin for WeatherError
impl UnwindSafe for WeatherError
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