pub struct SessionBuilder { /* private fields */ }
Expand description
Builder for Session
.
Implementations§
Source§impl SessionBuilder
impl SessionBuilder
Sourcepub fn with_test_emitter(self) -> Self
pub fn with_test_emitter(self) -> Self
Sets the diagnostic context to a test emitter.
Sourcepub fn with_stderr_emitter(self) -> Self
pub fn with_stderr_emitter(self) -> Self
Sets the diagnostic context to a stderr emitter.
Sourcepub fn with_stderr_emitter_and_color(self, color_choice: ColorChoice) -> Self
pub fn with_stderr_emitter_and_color(self, color_choice: ColorChoice) -> Self
Sets the diagnostic context to a stderr emitter and a color choice.
Sourcepub fn with_buffer_emitter(self, color_choice: ColorChoice) -> Self
pub fn with_buffer_emitter(self, color_choice: ColorChoice) -> Self
Sets the diagnostic context to a human emitter that emits diagnostics to a local buffer.
Sourcepub fn with_silent_emitter(self, fatal_note: Option<String>) -> Self
pub fn with_silent_emitter(self, fatal_note: Option<String>) -> Self
Sets the diagnostic context to a silent emitter.
Sourcepub fn single_threaded(self) -> Self
pub fn single_threaded(self) -> Self
Sets the number of threads to use for parallelism to 1.
Sourcepub fn threads(self, threads: usize) -> Self
pub fn threads(self, threads: usize) -> Self
Sets the number of threads to use for parallelism. Zero specifies the number of logical cores.
Sourcepub fn build(self) -> Session
pub fn build(self) -> Session
Consumes the builder to create a new session.
The diagnostics context must be set before calling this method, either by calling
dcx
or by using one of the provided helper methods, like
with_stderr_emitter
.
§Panics
Panics if:
- the diagnostics context is not set
- the source map in the diagnostics context does not match the one set in the builder
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for SessionBuilder
impl !RefUnwindSafe for SessionBuilder
impl Send for SessionBuilder
impl Sync for SessionBuilder
impl Unpin for SessionBuilder
impl !UnwindSafe for SessionBuilder
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, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
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