pub struct ProjectBuilder { /* private fields */ }Expand description
A builder for incrementally constructing a Project.
ProjectBuilder allows you to start from an existing codebase reflection
or from an empty state, and then add Modules one by one. When finished,
calling [build] returns a fully constructed Project with all module reflections
merged into a unified reflection.
Implementations§
Source§impl ProjectBuilder
impl ProjectBuilder
Sourcepub fn new(interner: ThreadedInterner) -> Self
pub fn new(interner: ThreadedInterner) -> Self
Creates a new empty ProjectBuilder using the provided interner.
This builder starts with an empty set of modules and an empty reflection.
§Arguments
interner- A reference to aThreadedInternerused for string interning and name resolution.
pub fn from_reflection( interner: ThreadedInterner, reflection: CodebaseReflection, ) -> Self
Sourcepub fn add_module(&mut self, module: Module)
pub fn add_module(&mut self, module: Module)
Sourcepub fn build(self, populate_non_user_defined: bool) -> Project
pub fn build(self, populate_non_user_defined: bool) -> Project
Consumes the builder and constructs a Project.
This method merges all the reflection data collected from the added modules,
optionally populating additional reflection for non-user-defined elements, and
returns a fully built Project.
§Arguments
populate_non_user_defined- A boolean flag indicating whether to populate reflection data for non-user-defined elements.
Trait Implementations§
Source§impl Clone for ProjectBuilder
impl Clone for ProjectBuilder
Source§fn clone(&self) -> ProjectBuilder
fn clone(&self) -> ProjectBuilder
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 moreAuto Trait Implementations§
impl Freeze for ProjectBuilder
impl !RefUnwindSafe for ProjectBuilder
impl Send for ProjectBuilder
impl Sync for ProjectBuilder
impl Unpin for ProjectBuilder
impl !UnwindSafe for ProjectBuilder
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,
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