pub struct ProcessBuilder { /* private fields */ }
Expand description
Builds an instance of a ProcessAllocator.
Builders are required because some of the state in a ProcessAllocator
cannot be sent between
threads (specifically, the Rc<RefCell<_>>
local channels). So, we must package up the state
shared between threads here, and then provide a method that will instantiate the non-movable
members once in the destination thread.
Implementations§
source§impl ProcessBuilder
impl ProcessBuilder
sourcepub fn new_vector(count: usize) -> Vec<ProcessBuilder>
pub fn new_vector(count: usize) -> Vec<ProcessBuilder>
Creates a vector of builders, sharing appropriate state.
This method requires access to a byte exchanger, from which it mints channels.
sourcepub fn build(self) -> ProcessAllocator
pub fn build(self) -> ProcessAllocator
Builds a ProcessAllocator
, instantiating Rc<RefCell<_>>
elements.
Trait Implementations§
source§impl AllocateBuilder for ProcessBuilder
impl AllocateBuilder for ProcessBuilder
Auto Trait Implementations§
impl Freeze for ProcessBuilder
impl RefUnwindSafe for ProcessBuilder
impl Send for ProcessBuilder
impl Sync for ProcessBuilder
impl Unpin for ProcessBuilder
impl UnwindSafe for ProcessBuilder
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