pub struct ThreadPoolOptionProto {
pub num_threads: i32,
pub global_name: String,
}
Fields§
§num_threads: i32
The number of threads in the pool.
0 means the system picks a value based on where this option proto is used (see the declaration of the specific field for more info).
global_name: String
The global name of the threadpool.
If empty, then the threadpool is made and used according to the scope it’s in - e.g., for a session threadpool, it is used by that session only.
If non-empty, then:
- a global threadpool associated with this name is looked up or created. This allows, for example, sharing one threadpool across many sessions (e.g., like the default behavior, if inter_op_parallelism_threads is not configured), but still partitioning into a large and small pool.
- if the threadpool for this global_name already exists, then it is an error if the existing pool was created using a different num_threads value as is specified on this call.
- threadpools created this way are never garbage collected.
Trait Implementations§
Source§impl Clone for ThreadPoolOptionProto
impl Clone for ThreadPoolOptionProto
Source§fn clone(&self) -> ThreadPoolOptionProto
fn clone(&self) -> ThreadPoolOptionProto
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ThreadPoolOptionProto
impl Debug for ThreadPoolOptionProto
Source§impl Default for ThreadPoolOptionProto
impl Default for ThreadPoolOptionProto
Source§impl Message for ThreadPoolOptionProto
impl Message for ThreadPoolOptionProto
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
Source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Encodes the message to a buffer. Read more
Source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Encodes the message with a length-delimiter to a buffer. Read more
Source§fn decode<B>(buf: B) -> Result<Self, DecodeError>
fn decode<B>(buf: B) -> Result<Self, DecodeError>
Decodes an instance of the message from a buffer. Read more
Source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
Decodes a length-delimited instance of the message from the buffer.
Source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
Decodes an instance of the message from a buffer, and merges it into
self
. Read moreSource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
Decodes a length-delimited instance of the message from buffer, and
merges it into
self
.Source§impl PartialEq for ThreadPoolOptionProto
impl PartialEq for ThreadPoolOptionProto
impl StructuralPartialEq for ThreadPoolOptionProto
Auto Trait Implementations§
impl Freeze for ThreadPoolOptionProto
impl RefUnwindSafe for ThreadPoolOptionProto
impl Send for ThreadPoolOptionProto
impl Sync for ThreadPoolOptionProto
impl Unpin for ThreadPoolOptionProto
impl UnwindSafe for ThreadPoolOptionProto
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