Struct grpcio::Environment
source · [−]pub struct Environment { /* private fields */ }
Expand description
An object that used to control concurrency and start gRPC event loop.
Implementations
sourceimpl Environment
impl Environment
sourcepub fn new(cq_count: usize) -> Environment
pub fn new(cq_count: usize) -> Environment
Initialize gRPC and create a thread pool to poll completion queue. The thread pool size
and the number of completion queue is specified by cq_count
. Each thread polls one
completion queue.
Panics
This method will panic if cq_count
is 0.
sourcepub fn completion_queues(&self) -> &[CompletionQueue]
pub fn completion_queues(&self) -> &[CompletionQueue]
Get all the created completion queues.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Environment
impl Send for Environment
impl Sync for Environment
impl Unpin for Environment
impl !UnwindSafe for Environment
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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