pub struct EcmaScriptYear(/* private fields */);Expand description
Calendar year for annual ECMAScript editions.
Implementations§
Source§impl EcmaScriptYear
impl EcmaScriptYear
Sourcepub const fn new(year: u16) -> Result<EcmaScriptYear, EcmaScriptParseError>
pub const fn new(year: u16) -> Result<EcmaScriptYear, EcmaScriptParseError>
Creates a supported ECMAScript edition year.
§Errors
Returns EcmaScriptParseError::UnsupportedYear when year is outside ES2015..=ES2024.
Trait Implementations§
Source§impl Clone for EcmaScriptYear
impl Clone for EcmaScriptYear
Source§fn clone(&self) -> EcmaScriptYear
fn clone(&self) -> EcmaScriptYear
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 EcmaScriptYear
impl Debug for EcmaScriptYear
Source§impl<'de> Deserialize<'de> for EcmaScriptYear
impl<'de> Deserialize<'de> for EcmaScriptYear
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<EcmaScriptYear, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<EcmaScriptYear, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for EcmaScriptYear
impl Display for EcmaScriptYear
Source§impl FromStr for EcmaScriptYear
impl FromStr for EcmaScriptYear
Source§type Err = EcmaScriptParseError
type Err = EcmaScriptParseError
The associated error which can be returned from parsing.
Source§fn from_str(
input: &str,
) -> Result<EcmaScriptYear, <EcmaScriptYear as FromStr>::Err>
fn from_str( input: &str, ) -> Result<EcmaScriptYear, <EcmaScriptYear as FromStr>::Err>
Parses a string
s to return a value of this type. Read moreSource§impl Hash for EcmaScriptYear
impl Hash for EcmaScriptYear
Source§impl Ord for EcmaScriptYear
impl Ord for EcmaScriptYear
Source§fn cmp(&self, other: &EcmaScriptYear) -> Ordering
fn cmp(&self, other: &EcmaScriptYear) -> 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 EcmaScriptYear
impl PartialEq for EcmaScriptYear
Source§fn eq(&self, other: &EcmaScriptYear) -> bool
fn eq(&self, other: &EcmaScriptYear) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for EcmaScriptYear
impl PartialOrd for EcmaScriptYear
Source§impl Serialize for EcmaScriptYear
impl Serialize for EcmaScriptYear
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for EcmaScriptYear
impl Eq for EcmaScriptYear
impl StructuralPartialEq for EcmaScriptYear
Auto Trait Implementations§
impl Freeze for EcmaScriptYear
impl RefUnwindSafe for EcmaScriptYear
impl Send for EcmaScriptYear
impl Sync for EcmaScriptYear
impl Unpin for EcmaScriptYear
impl UnsafeUnpin for EcmaScriptYear
impl UnwindSafe for EcmaScriptYear
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