pub enum Edition {
Edition2015,
Edition2018,
Edition2021,
}
Expand description
The edition of the compiler (RFC 2052)
Variants
Edition2015
The 2015 edition
Edition2018
The 2018 edition
Edition2021
The 2021 edition
Implementations
sourceimpl Edition
impl Edition
sourcepub const LATEST_UNSTABLE: Option<Edition> = None
pub const LATEST_UNSTABLE: Option<Edition> = None
The latest edition that is unstable.
This is None
if there is no next unstable edition.
sourcepub const LATEST_STABLE: Edition = Edition::Edition2021
pub const LATEST_STABLE: Edition = Edition::Edition2021
The latest stable edition.
sourcepub const CLI_VALUES: &'static [&'static str] = &["2015", "2018", "2021"]
pub const CLI_VALUES: &'static [&'static str] = &["2015", "2018", "2021"]
Possible values allowed for the --edition
CLI flag.
This requires a static value due to the way clap works, otherwise I would have built this dynamically.
sourcepub fn previous(&self) -> Option<Edition>
pub fn previous(&self) -> Option<Edition>
Returns the previous edition from this edition.
Returns None
for 2015.
sourcepub fn saturating_next(&self) -> Edition
pub fn saturating_next(&self) -> Edition
Returns the next edition from this edition, returning the last edition if this is already the last one.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Edition
impl<'de> Deserialize<'de> for Edition
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Ord for Edition
impl Ord for Edition
sourceimpl PartialOrd<Edition> for Edition
impl PartialOrd<Edition> for Edition
sourcefn partial_cmp(&self, other: &Edition) -> Option<Ordering>
fn partial_cmp(&self, other: &Edition) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Copy for Edition
impl Eq for Edition
impl StructuralEq for Edition
impl StructuralPartialEq for Edition
Auto Trait Implementations
impl RefUnwindSafe for Edition
impl Send for Edition
impl Sync for Edition
impl Unpin for Edition
impl UnwindSafe for Edition
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more