Struct slog_async::AsyncCoreBuilder
source · pub struct AsyncCoreBuilder<D>where
D: Drain<Err = Never, Ok = ()> + Send + 'static,{ /* private fields */ }
Expand description
AsyncCore
builder
Implementations§
source§impl<D> AsyncCoreBuilder<D>where
D: Drain<Err = Never, Ok = ()> + Send + 'static,
impl<D> AsyncCoreBuilder<D>where D: Drain<Err = Never, Ok = ()> + Send + 'static,
sourcepub fn thread_name(self, name: String) -> Self
pub fn thread_name(self, name: String) -> Self
Configure a name to be used for the background thread.
The name must not contain ‘\0’.
Panics
If a name with ‘\0’ is passed.
sourcepub fn chan_size(self, s: usize) -> Self
pub fn chan_size(self, s: usize) -> Self
Set channel size used to send logging records to worker thread. When
buffer is full AsyncCore
will start returning AsyncError::Full
or block, depending on
the blocking
configuration.
sourcepub fn blocking(self, blocking: bool) -> Self
pub fn blocking(self, blocking: bool) -> Self
Should the logging call be blocking if the channel is full?
Default is false, in which case it’ll return AsyncError::Full
.
sourcepub fn build_no_guard(self) -> AsyncCore
pub fn build_no_guard(self) -> AsyncCore
Build AsyncCore
sourcepub fn build_with_guard(self) -> (AsyncCore, AsyncGuard)
pub fn build_with_guard(self) -> (AsyncCore, AsyncGuard)
Build AsyncCore
with AsyncGuard
See AsyncGuard
for more information.
Auto Trait Implementations§
impl<D> RefUnwindSafe for AsyncCoreBuilder<D>where D: RefUnwindSafe,
impl<D> Send for AsyncCoreBuilder<D>
impl<D> Sync for AsyncCoreBuilder<D>where D: Sync,
impl<D> Unpin for AsyncCoreBuilder<D>where D: Unpin,
impl<D> UnwindSafe for AsyncCoreBuilder<D>where D: UnwindSafe,
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