LocalIO

Struct LocalIO 

Source
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>

Source

pub fn new( data_provider: DP, finalization_handler: FH, unit_saver: US, unit_loader: UL, ) -> Self

Create a new local interface. Note that this uses the simplified, and recommended, finalization handler that only deals with ordered data.

Source§

impl<DP: DataProvider, UFH: UnitFinalizationHandler, US: AsyncWrite, UL: AsyncRead> LocalIO<DP, UFH, US, UL>

Source

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.

Source

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>

Source§

fn clone(&self) -> LocalIO<DP, UFH, US, UL>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl<DP, UFH, US, UL> Freeze for LocalIO<DP, UFH, US, UL>
where DP: Freeze, UFH: Freeze, US: Freeze, UL: Freeze,

§

impl<DP, UFH, US, UL> RefUnwindSafe for LocalIO<DP, UFH, US, UL>

§

impl<DP, UFH, US, UL> Send for LocalIO<DP, UFH, US, UL>
where US: Send, UL: Send,

§

impl<DP, UFH, US, UL> Sync for LocalIO<DP, UFH, US, UL>
where US: Sync, UL: Sync,

§

impl<DP, UFH, US, UL> Unpin for LocalIO<DP, UFH, US, UL>
where DP: Unpin, UFH: Unpin, US: Unpin, UL: Unpin,

§

impl<DP, UFH, US, UL> UnwindSafe for LocalIO<DP, UFH, US, UL>
where DP: UnwindSafe, UFH: UnwindSafe, US: UnwindSafe, UL: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V