pub struct ThreadObjectWriterBuilder<W, F: Send + FnOnce() -> Result<W>> {
thunk: F,
name: String,
capacity: usize,
}
Fields§
§thunk: F
§name: String
§capacity: usize
Implementations§
Source§impl<W, F: Send + FnOnce() -> Result<W>> ThreadObjectWriterBuilder<W, F>
impl<W, F: Send + FnOnce() -> Result<W>> ThreadObjectWriterBuilder<W, F>
Sourcepub fn with_capacity(self, cap: usize) -> Self
pub fn with_capacity(self, cap: usize) -> Self
Set the channel capacity for this thread writer. Defaults to 100.
Sourcepub fn with_name<S: Into<Cow<'static, str>>>(self, name: S) -> Self
pub fn with_name<S: Into<Cow<'static, str>>>(self, name: S) -> Self
Set a name for this thread writer for debugging.
Sourcepub fn spawn_scoped<'scope, 'env, T>(
self,
scope: &'scope Scope<'scope, 'env>,
) -> ThreadObjectWriter<'scope, T>
pub fn spawn_scoped<'scope, 'env, T>( self, scope: &'scope Scope<'scope, 'env>, ) -> ThreadObjectWriter<'scope, T>
Spawn the thread writer.
Sourcepub fn spawn<T>(self) -> ThreadObjectWriter<'static, T>
pub fn spawn<T>(self) -> ThreadObjectWriter<'static, T>
Spawn the thread writer.
Auto Trait Implementations§
impl<W, F> Freeze for ThreadObjectWriterBuilder<W, F>where
F: Freeze,
impl<W, F> RefUnwindSafe for ThreadObjectWriterBuilder<W, F>where
F: RefUnwindSafe,
impl<W, F> Send for ThreadObjectWriterBuilder<W, F>
impl<W, F> Sync for ThreadObjectWriterBuilder<W, F>where
F: Sync,
impl<W, F> Unpin for ThreadObjectWriterBuilder<W, F>where
F: Unpin,
impl<W, F> UnwindSafe for ThreadObjectWriterBuilder<W, F>where
F: 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