Struct grpcio::EnvBuilder
source · [−]pub struct EnvBuilder { /* private fields */ }
Expand description
Environment
factory in order to configure the properties.
Implementations
sourceimpl EnvBuilder
impl EnvBuilder
sourcepub fn new() -> EnvBuilder
pub fn new() -> EnvBuilder
Initialize a new EnvBuilder
.
sourcepub fn cq_count(self, count: usize) -> EnvBuilder
pub fn cq_count(self, count: usize) -> EnvBuilder
Set the number of completion queues and polling threads. Each thread polls one completion queue.
Panics
This method will panic if count
is 0.
sourcepub fn name_prefix<S: Into<String>>(self, prefix: S) -> EnvBuilder
pub fn name_prefix<S: Into<String>>(self, prefix: S) -> EnvBuilder
Set the thread name prefix of each polling thread.
sourcepub fn after_start<F: Fn() + Send + Sync + 'static>(self, f: F) -> EnvBuilder
pub fn after_start<F: Fn() + Send + Sync + 'static>(self, f: F) -> EnvBuilder
Execute function f
after each thread is started but before it starts doing work.
sourcepub fn before_stop<F: Fn() + Send + Sync + 'static>(self, f: F) -> EnvBuilder
pub fn before_stop<F: Fn() + Send + Sync + 'static>(self, f: F) -> EnvBuilder
Execute function f
before each thread stops.
sourcepub fn build(self) -> Environment
pub fn build(self) -> Environment
Finalize the EnvBuilder
, build the Environment
and initialize the gRPC library.
Auto Trait Implementations
impl !RefUnwindSafe for EnvBuilder
impl Send for EnvBuilder
impl Sync for EnvBuilder
impl Unpin for EnvBuilder
impl !UnwindSafe for EnvBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more