Skip to main content

IssueBuffer

Struct IssueBuffer 

Source
pub struct IssueBuffer { /* private fields */ }

Implementations§

Source§

impl IssueBuffer

Source

pub fn new() -> Self

Source

pub fn add(&mut self, issue: Issue)

Source

pub fn add_suppression(&mut self, name: impl Into<String>)

Source

pub fn into_issues(self) -> Vec<Issue>

Consume the buffer and return unsuppressed issues.

Source

pub fn into_all_issues(self) -> Vec<Issue>

Like into_issues but keeps suppressed issues (with suppressed = true) so callers that need to detect unused suppressions can see which issues were silenced. File-level suppressions are also marked suppressed = true rather than dropped.

Source

pub fn suppress_range(&mut self, from: usize, suppressions: &[String])

Mark all issues added since index from as suppressed if their issue name appears in suppressions. Used for @psalm-suppress / @suppress on statements.

Source

pub fn issue_count(&self) -> usize

Current number of buffered issues. Use before analyzing a statement to get the from index for suppress_range.

Source

pub fn truncate_to(&mut self, mark: usize)

Discard every issue added since index mark, un-marking their locations as seen so a later add() at the same spot isn’t silently deduplicated away. Used to roll back a speculative analysis pass (e.g. an unstabilized loop fixed-point iteration) whose diagnostics were provisional and must not leak into the final result.

Source

pub fn is_empty(&self) -> bool

Source

pub fn len(&self) -> usize

Source

pub fn error_count(&self) -> usize

Source

pub fn warning_count(&self) -> usize

Trait Implementations§

Source§

impl Debug for IssueBuffer

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for IssueBuffer

Source§

fn default() -> IssueBuffer

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.