Struct ecpool::ErasureCoderPool [−][src]
pub struct ErasureCoderPool<B> { /* fields omitted */ }
Thread pool for encoding and decoding data by using an ErasureCode
implementation.
Internally, this uses fibers_tasque::DefaultCpuTaskQueue
for realizing thread pool functionality.
Methods
impl<B: BuildCoder> ErasureCoderPool<B>
[src]
impl<B: BuildCoder> ErasureCoderPool<B>
pub fn new(builder: B) -> Self
[src]
pub fn new(builder: B) -> Self
Makes a new ErasureCoderPool
instance.
pub fn encode<T>(
&self,
data: T
) -> impl Future<Item = Vec<FragmentBuf>, Error = Error> where
T: AsRef<[u8]> + Send + 'static,
[src]
pub fn encode<T>(
&self,
data: T
) -> impl Future<Item = Vec<FragmentBuf>, Error = Error> where
T: AsRef<[u8]> + Send + 'static,
Encodes the given data to fragments asynchronously.
The encoding process will be executed on a thread in the pool.
The result vector contains N
data fragments and M
parity fragments
(where N = self.data_fragments()
and M = self.parity_fragments()
).
pub fn decode<T>(
&self,
fragments: Vec<T>
) -> impl Future<Item = Vec<u8>, Error = Error> where
T: AsRef<Fragment> + Send + 'static,
[src]
pub fn decode<T>(
&self,
fragments: Vec<T>
) -> impl Future<Item = Vec<u8>, Error = Error> where
T: AsRef<Fragment> + Send + 'static,
Decodes the original data from the given fragments asynchronously.
The decoding process will be executed on a thread in the pool.
Note whether the correctness of the result data has been validated depends on the implementations.
pub fn reconstruct<T>(
&self,
index: usize,
fragments: Vec<T>
) -> impl Future<Item = Vec<u8>, Error = Error> where
T: AsRef<Fragment> + Send + 'static,
[src]
pub fn reconstruct<T>(
&self,
index: usize,
fragments: Vec<T>
) -> impl Future<Item = Vec<u8>, Error = Error> where
T: AsRef<Fragment> + Send + 'static,
Reconstructs the fragment specified by the given index from other fragments asynchronously.
The reconstruction process will be executed on a thread in the pool.
Trait Implementations
impl<B: Debug> Debug for ErasureCoderPool<B>
[src]
impl<B: Debug> Debug for ErasureCoderPool<B>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<B: Clone> Clone for ErasureCoderPool<B>
[src]
impl<B: Clone> Clone for ErasureCoderPool<B>
fn clone(&self) -> ErasureCoderPool<B>
[src]
fn clone(&self) -> ErasureCoderPool<B>
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)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl<B> Send for ErasureCoderPool<B> where
B: Send,
impl<B> Send for ErasureCoderPool<B> where
B: Send,
impl<B> Sync for ErasureCoderPool<B> where
B: Sync,
impl<B> Sync for ErasureCoderPool<B> where
B: Sync,