[−][src]Struct flatbuffers_pool::FlatBufferBuilderPool
FlatBufferBuilder
pool.
Examples
use flatbuffers_pool::FlatBufferBuilderPool; let mut b = FlatBufferBuilderPool::get(); let name = b.create_string("something fun"); b.finish(name, None);
Methods
impl FlatBufferBuilderPool
[src]
pub fn get() -> GlobalBuilder
[src]
Get the FlatBufferBuilder
from the global pool.
Examples
use flatbuffers_pool::FlatBufferBuilderPool; let mut b = FlatBufferBuilderPool::get(); let name = b.create_string("something fun"); b.finish(name, None);
pub fn init_global_pool_size(size: usize)
[src]
Change the initial global pool size.
It should be called before calling the first get
function otherwise the change won't applicable.
Examples
use flatbuffers_pool::FlatBufferBuilderPool; FlatBufferBuilderPool::init_global_pool_size(0); let mut b = FlatBufferBuilderPool::get(); let name = b.create_string("something fun"); b.finish(name, None);
pub fn max_global_pool_size(size: usize)
[src]
Change the maximum global pool size.
It should be called before calling the first get
function otherwise the change won't applicable.
Examples
use flatbuffers_pool::FlatBufferBuilderPool; FlatBufferBuilderPool::max_global_pool_size(4); let mut b = FlatBufferBuilderPool::get(); let name = b.create_string("something fun"); b.finish(name, None);
pub fn global_buffer_capacity(capacity: usize)
[src]
Change the initial FlatBufferBuilder
buffer size.
The value only applicable for the newly allocated
FlatBufferBuilder
instances.
Examples
use flatbuffers_pool::FlatBufferBuilderPool; FlatBufferBuilderPool::global_buffer_capacity(64); let mut b = FlatBufferBuilderPool::get(); let name = b.create_string("something fun"); b.finish(name, None);
impl FlatBufferBuilderPool
[src]
pub fn new() -> Self
[src]
Create a local FlatBufferBuilder
pool instance.
Examples
use flatbuffers_pool::FlatBufferBuilderPool; // Get the builder from the local pool. let mut pool = FlatBufferBuilderPool::new().build(); let mut b = pool.get(); let name = b.create_string("something fun"); b.finish(name, None);
pub fn init_pool_size(self, size: usize) -> Self
[src]
Change the initial local pool size.
It should be called before calling the first get
function otherwise the change won't applicable.
Examples
use flatbuffers_pool::FlatBufferBuilderPool; // Get the builder from the local pool. let pool = FlatBufferBuilderPool::new() .init_pool_size(0) .build(); let mut b = pool.get(); let name = b.create_string("something fun"); b.finish(name, None);
pub fn max_pool_size(self, size: usize) -> Self
[src]
Change the maximum local pool size.
It should be called before calling the first get
function otherwise the change won't applicable.
Examples
use flatbuffers_pool::FlatBufferBuilderPool; // Get the builder from the local pool. let pool = FlatBufferBuilderPool::new() .max_pool_size(4) .build(); let mut b = pool.get(); let name = b.create_string("something fun"); b.finish(name, None);
pub fn buffer_capacity(self, capacity: usize) -> Self
[src]
Change the initial FlatBufferBuilder
buffer size.
The value only applicable for the newly allocated
FlatBufferBuilder
instances.
Examples
use flatbuffers_pool::FlatBufferBuilderPool; // Get the builder from the local pool. let pool = FlatBufferBuilderPool::new() .buffer_capacity(64) .build(); let mut b = pool.get(); let name = b.create_string("something fun"); b.finish(name, None);
pub fn build<'a>(&self) -> FlatBufferBuilderLocalPool<'a>
[src]
Build a local FlatBufferBuilder
pool.
Examples
use flatbuffers_pool::FlatBufferBuilderPool; // Get the builder from the local pool. let pool = FlatBufferBuilderPool::new() .build(); let mut b = pool.get(); let name = b.create_string("something fun"); b.finish(name, None);
Trait Implementations
impl Default for FlatBufferBuilderPool
[src]
Auto Trait Implementations
impl RefUnwindSafe for FlatBufferBuilderPool
impl Send for FlatBufferBuilderPool
impl Sync for FlatBufferBuilderPool
impl Unpin for FlatBufferBuilderPool
impl UnwindSafe for FlatBufferBuilderPool
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,