pub struct ThreadWriterSatellite<'a, 'scope, T>{
delegate: &'a ThreadObjectWriter<'scope, T>,
sender: Sender<T>,
}
Expand description
Child writer to allow objects to be written to a threaded writer from multiple threads, allowing parallel feeding of data. It takes a reference to the original thread writer, so it needs to be used with std::thread::scope. The original writer still needs to be closed, and this design ensures that the original cannot be closed until all the children are finished.
Fields§
§delegate: &'a ThreadObjectWriter<'scope, T>
§sender: Sender<T>
Implementations§
Source§impl<'a, 'scope, T> ThreadWriterSatellite<'a, 'scope, T>
impl<'a, 'scope, T> ThreadWriterSatellite<'a, 'scope, T>
Sourcefn create(
delegate: &'a ThreadObjectWriter<'scope, T>,
) -> ThreadWriterSatellite<'a, 'scope, T>
fn create( delegate: &'a ThreadObjectWriter<'scope, T>, ) -> ThreadWriterSatellite<'a, 'scope, T>
Create a new thread child writer.
Trait Implementations§
Source§impl<'a, 'scope, T> Clone for ThreadWriterSatellite<'a, 'scope, T>
impl<'a, 'scope, T> Clone for ThreadWriterSatellite<'a, 'scope, T>
Source§fn clone(&self) -> ThreadWriterSatellite<'a, 'scope, T>
fn clone(&self) -> ThreadWriterSatellite<'a, 'scope, T>
Returns a copy 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<'a, 'scope, T> ObjectWriter<T> for ThreadWriterSatellite<'a, 'scope, T>
impl<'a, 'scope, T> ObjectWriter<T> for ThreadWriterSatellite<'a, 'scope, T>
Source§fn write_object(&mut self, object: T) -> Result<()>
fn write_object(&mut self, object: T) -> Result<()>
Write one object.
Source§fn write_all_objects<I>(&mut self, objects: I) -> Result<usize>where
I: Iterator<Item = T>,
fn write_all_objects<I>(&mut self, objects: I) -> Result<usize>where
I: Iterator<Item = T>,
Write an iterator full of objects.
Auto Trait Implementations§
impl<'a, 'scope, T> Freeze for ThreadWriterSatellite<'a, 'scope, T>
impl<'a, 'scope, T> !RefUnwindSafe for ThreadWriterSatellite<'a, 'scope, T>
impl<'a, 'scope, T> Send for ThreadWriterSatellite<'a, 'scope, T>
impl<'a, 'scope, T> Sync for ThreadWriterSatellite<'a, 'scope, T>
impl<'a, 'scope, T> Unpin for ThreadWriterSatellite<'a, 'scope, T>
impl<'a, 'scope, T> !UnwindSafe for ThreadWriterSatellite<'a, 'scope, T>
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