pub struct BlockReconstructor<F> { /* private fields */ }
Expand description
Tool for reconstructing block-wise messages.
This mechanism was designed so that it can be used successfully with block1
(request payload)
and block2
(response payload) messages.
Implementations§
Source§impl<F> BlockReconstructor<F>where
F: Write,
impl<F> BlockReconstructor<F>where
F: Write,
Sourcepub fn new(write: F, next_block: BlockInfo) -> BlockReconstructor<F>
pub fn new(write: F, next_block: BlockInfo) -> BlockReconstructor<F>
Creates a new instance of BlockReconstructor
.
Sourcepub fn next_block(&self) -> BlockInfo
pub fn next_block(&self) -> BlockInfo
The next block this object wants.
Sourcepub fn is_finished(&self) -> bool
pub fn is_finished(&self) -> bool
Returns true if we have received all of our blocks and have no additional processing to perform.
Sourcepub fn into_inner(self) -> F
pub fn into_inner(self) -> F
Consumes this object and returns the underlying std::io::Write
instance.
Trait Implementations§
Source§impl<F: Debug> Debug for BlockReconstructor<F>
impl<F: Debug> Debug for BlockReconstructor<F>
Auto Trait Implementations§
impl<F> Freeze for BlockReconstructor<F>where
F: Freeze,
impl<F> RefUnwindSafe for BlockReconstructor<F>where
F: RefUnwindSafe,
impl<F> Send for BlockReconstructor<F>where
F: Send,
impl<F> Sync for BlockReconstructor<F>where
F: Sync,
impl<F> Unpin for BlockReconstructor<F>where
F: Unpin,
impl<F> UnwindSafe for BlockReconstructor<F>where
F: UnwindSafe,
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