pub struct LocalIO<DP: DataProvider, UFH: UnitFinalizationHandler, US: AsyncWrite, UL: AsyncRead> { /* private fields */ }Expand description
The local interface of the consensus algorithm. Contains a DataProvider as a source of data
to order, a UnitFinalizationHandler for handling ordered units, and a pair of read/write
structs intended for saving and restorin the state of the algorithm within the session, as a
contingency in the case of a crash.
Implementations§
Source§impl<H: Hasher, DP: DataProvider, FH: FinalizationHandler<DP::Output>, US: AsyncWrite, UL: AsyncRead> LocalIO<DP, FinalizationHandlerAdapter<FH, DP::Output, H>, US, UL>
impl<H: Hasher, DP: DataProvider, FH: FinalizationHandler<DP::Output>, US: AsyncWrite, UL: AsyncRead> LocalIO<DP, FinalizationHandlerAdapter<FH, DP::Output, H>, US, UL>
Source§impl<DP: DataProvider, UFH: UnitFinalizationHandler, US: AsyncWrite, UL: AsyncRead> LocalIO<DP, UFH, US, UL>
impl<DP: DataProvider, UFH: UnitFinalizationHandler, US: AsyncWrite, UL: AsyncRead> LocalIO<DP, UFH, US, UL>
Sourcepub fn new_with_unit_finalization_handler(
data_provider: DP,
finalization_handler: UFH,
unit_saver: US,
unit_loader: UL,
) -> Self
pub fn new_with_unit_finalization_handler( data_provider: DP, finalization_handler: UFH, unit_saver: US, unit_loader: UL, ) -> Self
Create a new local interface, providing a full implementation of a
UnitFinalizationHandler.Implementing UnitFinalizationHandler directly is more
complex, and should be unnecessary for most usecases. Implement FinalizationHandler
and use new instead, unless you absolutely know what you are doing.
Sourcepub fn into_components(self) -> (DP, UFH, US, UL)
pub fn into_components(self) -> (DP, UFH, US, UL)
Disassemble the interface into components.
Trait Implementations§
Source§impl<DP: Clone + DataProvider, UFH: Clone + UnitFinalizationHandler, US: Clone + AsyncWrite, UL: Clone + AsyncRead> Clone for LocalIO<DP, UFH, US, UL>
impl<DP: Clone + DataProvider, UFH: Clone + UnitFinalizationHandler, US: Clone + AsyncWrite, UL: Clone + AsyncRead> Clone for LocalIO<DP, UFH, US, UL>
Auto Trait Implementations§
impl<DP, UFH, US, UL> Freeze for LocalIO<DP, UFH, US, UL>
impl<DP, UFH, US, UL> RefUnwindSafe for LocalIO<DP, UFH, US, UL>
impl<DP, UFH, US, UL> Send for LocalIO<DP, UFH, US, UL>
impl<DP, UFH, US, UL> Sync for LocalIO<DP, UFH, US, UL>
impl<DP, UFH, US, UL> Unpin for LocalIO<DP, UFH, US, UL>
impl<DP, UFH, US, UL> UnwindSafe for LocalIO<DP, UFH, US, UL>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more