Struct jemalloc_ctl::MaxBackgroundThreads [−][src]
pub struct MaxBackgroundThreads(_);
A type providing access to the maximum number of background threads that will be created.
extern crate jemallocator; extern crate jemalloc_ctl; #[global_allocator] static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; fn main() { let mut max_background_threads = jemalloc_ctl::MaxBackgroundThreads::new().unwrap(); max_background_threads.set(1).unwrap(); assert_eq!(max_background_threads.get().unwrap(), 1); }
Methods
impl MaxBackgroundThreads
[src]
impl MaxBackgroundThreads
pub fn new() -> Result<MaxBackgroundThreads>
[src]
pub fn new() -> Result<MaxBackgroundThreads>
Returns a new MaxBackgroundThreads
.
pub fn get(&self) -> Result<usize>
[src]
pub fn get(&self) -> Result<usize>
Returns the current background thread limit.
pub fn set(&self, max_background_threads: usize) -> Result<()>
[src]
pub fn set(&self, max_background_threads: usize) -> Result<()>
Sets the background thread limit.
Trait Implementations
impl Copy for MaxBackgroundThreads
[src]
impl Copy for MaxBackgroundThreads
impl Clone for MaxBackgroundThreads
[src]
impl Clone for MaxBackgroundThreads
fn clone(&self) -> MaxBackgroundThreads
[src]
fn clone(&self) -> MaxBackgroundThreads
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl Send for MaxBackgroundThreads
impl Send for MaxBackgroundThreads
impl Sync for MaxBackgroundThreads
impl Sync for MaxBackgroundThreads