pub struct AllowStore { /* private fields */ }Expand description
Store for allow directives extracted from source files.
Caches CommentSpec information per symbol name for efficient lookups during suggestion filtering.
Implementations§
Source§impl AllowStore
impl AllowStore
Sourcepub fn from_context(ctx: &AnalysisContext) -> Self
pub fn from_context(ctx: &AnalysisContext) -> Self
Build AllowStore from AnalysisContext.
Extracts all CommentSpec directives from all files in the context.
Sourcepub fn is_allowed(&self, symbol_name: &str, rule_id: &str) -> bool
pub fn is_allowed(&self, symbol_name: &str, rule_id: &str) -> bool
Check if a rule is allowed for a specific symbol.
Returns true if the rule should be skipped (i.e., is allowed).
Sourcepub fn is_allowed_for_symbols(
&self,
ctx: &AnalysisContext,
symbol_ids: &[SymbolId],
rule_id: &str,
) -> bool
pub fn is_allowed_for_symbols( &self, ctx: &AnalysisContext, symbol_ids: &[SymbolId], rule_id: &str, ) -> bool
Check if a rule is allowed for any of the given symbol IDs.
Looks up symbol names from the registry and checks allow directives.
Sourcepub fn get(&self, symbol_name: &str) -> Option<&CommentSpec>
pub fn get(&self, symbol_name: &str) -> Option<&CommentSpec>
Get the CommentSpec for a symbol if it exists.
Trait Implementations§
Source§impl Debug for AllowStore
impl Debug for AllowStore
Source§impl Default for AllowStore
impl Default for AllowStore
Source§fn default() -> AllowStore
fn default() -> AllowStore
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AllowStore
impl RefUnwindSafe for AllowStore
impl Send for AllowStore
impl Sync for AllowStore
impl Unpin for AllowStore
impl UnsafeUnpin for AllowStore
impl UnwindSafe for AllowStore
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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