pub(crate) struct PatternContext {
pub(crate) refutability: PatternRefutability,
pub(crate) param_ctx: Option<ParamContext>,
pub(crate) has_type_ascription: bool,
pub(crate) should_suggest_name: bool,
pub(crate) after_if_expr: bool,
pub(crate) parent_pat: Option<Pat>,
pub(crate) ref_token: Option<SyntaxToken>,
pub(crate) mut_token: Option<SyntaxToken>,
pub(crate) record_pat: Option<RecordPat>,
pub(crate) impl_or_trait: Option<Either<Impl, Trait>>,
pub(crate) missing_variants: Vec<Variant>,
}Expand description
The state of the pattern we are completing.
Fields§
§refutability: PatternRefutability§param_ctx: Option<ParamContext>§has_type_ascription: bool§should_suggest_name: bool§after_if_expr: bool§parent_pat: Option<Pat>§ref_token: Option<SyntaxToken>§mut_token: Option<SyntaxToken>§record_pat: Option<RecordPat>The record pattern this name or ref is a field of
impl_or_trait: Option<Either<Impl, Trait>>§missing_variants: Vec<Variant>List of missing variants in a match expr
Trait Implementations§
Source§impl Clone for PatternContext
impl Clone for PatternContext
Source§fn clone(&self) -> PatternContext
fn clone(&self) -> PatternContext
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 moreSource§impl Debug for PatternContext
impl Debug for PatternContext
Source§impl PartialEq for PatternContext
impl PartialEq for PatternContext
impl Eq for PatternContext
impl StructuralPartialEq for PatternContext
Auto Trait Implementations§
impl Freeze for PatternContext
impl !RefUnwindSafe for PatternContext
impl !Send for PatternContext
impl !Sync for PatternContext
impl Unpin for PatternContext
impl !UnwindSafe for PatternContext
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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