pub enum KeywordUse {
Statement,
Type,
Specifier,
Expression,
Member,
}Expand description
Which of a keyword’s several shapes a cursor is in.
A keyword’s own grammar decides which positions it fits, and the three this can answer are the three a reader
notices: while is a statement and never a type, void is a type and never a statement, static is a
specifier and can start a declaration of either.
Variants§
Statement
A statement or a control-flow clause: return, while, case, else.
Type
A type specifier: void, int, auto, decltype, bool.
Specifier
A declaration specifier that may begin a declaration of any kind: const, static, namespace, using.
Expression
A literal or an operator keyword that is an expression in its own right: true, false, nullptr,
this, new, delete, sizeof, throw.
Member
A name that is only meaningful inside a class body or a class head: public, virtual, friend,
explicit, mutable, override is not a keyword but final is not one either — only the keywords are
listed.
Trait Implementations§
Source§impl Clone for KeywordUse
impl Clone for KeywordUse
impl Copy for KeywordUse
Source§impl Debug for KeywordUse
impl Debug for KeywordUse
impl Eq for KeywordUse
Source§impl Hash for KeywordUse
impl Hash for KeywordUse
Source§impl Ord for KeywordUse
impl Ord for KeywordUse
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for KeywordUse
impl PartialEq for KeywordUse
Source§impl PartialOrd for KeywordUse
impl PartialOrd for KeywordUse
impl StructuralPartialEq for KeywordUse
Auto Trait Implementations§
impl Forget for KeywordUse
impl Freeze for KeywordUse
impl Move for KeywordUse
impl RefUnwindSafe for KeywordUse
impl Send for KeywordUse
impl Sync for KeywordUse
impl Unpin for KeywordUse
impl UnsafeUnpin for KeywordUse
impl UnwindSafe for KeywordUse
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more