pub struct ResolutionReportBuilder { /* private fields */ }Expand description
The fallible writer every report passes through.
Implementations§
Source§impl ResolutionReportBuilder
impl ResolutionReportBuilder
Sourcepub fn new(tier: ResolutionTier, limits: ResolutionReportLimits) -> Self
pub fn new(tier: ResolutionTier, limits: ResolutionReportLimits) -> Self
An empty builder for one tier under one set of limits.
Sourcepub fn add_unit(
&mut self,
language: Language,
key: Arc<str>,
name: Arc<str>,
) -> Result<ResolutionUnitHandle, ResolutionReportError>
pub fn add_unit( &mut self, language: Language, key: Arc<str>, name: Arc<str>, ) -> Result<ResolutionUnitHandle, ResolutionReportError>
State one resolution unit.
Sourcepub fn add_definition(
&mut self,
unit: &ResolutionUnitHandle,
kind: SymbolKind,
name: Arc<str>,
span: SourceSpan,
parent: Option<&DefinitionHandle>,
) -> Result<DefinitionHandle, ResolutionReportError>
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.
Sourcepub fn add_reference(
&mut self,
unit: &ResolutionUnitHandle,
kind: ReferenceKind,
text: Arc<str>,
span: SourceSpan,
enclosing_definition: Option<&DefinitionHandle>,
) -> Result<ReferenceHandle, ResolutionReportError>
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.
Sourcepub fn set_resolution(
&mut self,
reference: &ReferenceHandle,
candidates: Box<[CandidateInput]>,
gaps: Box<[ResolutionGap]>,
) -> Result<(), ResolutionReportError>
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.
Sourcepub fn finish(self) -> Result<ResolutionReport, ResolutionReportError>
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§
impl Freeze for ResolutionReportBuilder
impl RefUnwindSafe for ResolutionReportBuilder
impl Send for ResolutionReportBuilder
impl Sync for ResolutionReportBuilder
impl Unpin for ResolutionReportBuilder
impl UnsafeUnpin for ResolutionReportBuilder
impl UnwindSafe for ResolutionReportBuilder
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