Skip to main content

ResolutionReportBuilder

Struct ResolutionReportBuilder 

Source
pub struct ResolutionReportBuilder { /* private fields */ }
Expand description

The fallible writer every report passes through.

Implementations§

Source§

impl ResolutionReportBuilder

Source

pub fn new(tier: ResolutionTier, limits: ResolutionReportLimits) -> Self

An empty builder for one tier under one set of limits.

Source

pub fn add_unit( &mut self, language: Language, key: Arc<str>, name: Arc<str>, ) -> Result<ResolutionUnitHandle, ResolutionReportError>

State one resolution unit.

Source

pub fn add_definition( &mut self, unit: &ResolutionUnitHandle, kind: SymbolKind, name: Arc<str>, span: SourceSpan, parent: Option<&DefinitionHandle>, ) -> Result<DefinitionHandle, ResolutionReportError>

State one definition inside a unit this builder issued.

Source

pub fn add_reference( &mut self, unit: &ResolutionUnitHandle, kind: ReferenceKind, text: Arc<str>, span: SourceSpan, enclosing_definition: Option<&DefinitionHandle>, ) -> Result<ReferenceHandle, ResolutionReportError>

State one reference inside a unit this builder issued.

Source

pub fn set_resolution( &mut self, reference: &ReferenceHandle, candidates: Box<[CandidateInput]>, gaps: Box<[ResolutionGap]>, ) -> Result<(), ResolutionReportError>

State the answer for one reference this builder issued.

Source

pub fn finish(self) -> Result<ResolutionReport, ResolutionReportError>

Sort, assign identifiers, validate, and return the report.

The drafts move into the report: a writer that has finished stating facts owns nothing the report needs to copy.

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<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, 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.