pub struct SessionBuilder { /* private fields */ }
Expand description
Session
builder.
Implementations§
Source§impl SessionBuilder
impl SessionBuilder
Sourcepub fn dcx(self, dcx: DiagCtxt) -> Self
pub fn dcx(self, dcx: DiagCtxt) -> Self
Sets the diagnostic context. This is required.
See also the with_*_emitter*
methods.
Sourcepub fn source_map(self, source_map: Arc<SourceMap>) -> Self
pub fn source_map(self, source_map: Arc<SourceMap>) -> Self
Sets the source map.
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§
Source§impl Default for SessionBuilder
impl Default for SessionBuilder
Source§fn default() -> SessionBuilder
fn default() -> SessionBuilder
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
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> ⓘ
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> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 1384 bytes