PartialOrder

Struct PartialOrder 

Source
pub struct PartialOrder<L, E, OS, POS> { /* private fields */ }
Expand description

Struct for processing p2panda operations into a partial order based on dependencies expressed in their previous field.

This struct is a thin wrapper around ordering::PartialOrder struct which takes care of sorting the operation dependency graph into a partial order. Here we have the addition of a LogStore and OperationStore implementation (traits from p2panda-store).

Implementations§

Source§

impl<L, E, OS, POS> PartialOrder<L, E, OS, POS>
where OS: OperationStore<L, E> + LogStore<L, E>, POS: PartialOrderStore<Hash>, E: Extensions,

Source

pub fn new(operation_store: OS, partial_order_store: POS) -> Self

Construct a new dependency checker from an operation store and dependency store.

Source

pub async fn process( &mut self, operation: Operation<E>, ) -> Result<(), OperationDependencyCheckerError>

Process a single operation.

Source

pub async fn next( &mut self, ) -> Result<Option<Operation<E>>, OperationDependencyCheckerError>

Take the next ready operation from the queue.

Trait Implementations§

Source§

impl<L: Debug, E: Debug, OS: Debug, POS: Debug> Debug for PartialOrder<L, E, OS, POS>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<L, E, OS, POS> Freeze for PartialOrder<L, E, OS, POS>
where OS: Freeze, POS: Freeze,

§

impl<L, E, OS, POS> RefUnwindSafe for PartialOrder<L, E, OS, POS>

§

impl<L, E, OS, POS> Send for PartialOrder<L, E, OS, POS>
where OS: Send, POS: Send, L: Send, E: Send,

§

impl<L, E, OS, POS> Sync for PartialOrder<L, E, OS, POS>
where OS: Sync, POS: Sync, L: Sync, E: Sync,

§

impl<L, E, OS, POS> Unpin for PartialOrder<L, E, OS, POS>
where OS: Unpin, POS: Unpin, L: Unpin, E: Unpin,

§

impl<L, E, OS, POS> UnwindSafe for PartialOrder<L, E, OS, POS>
where OS: UnwindSafe, POS: UnwindSafe, L: UnwindSafe, E: 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> 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> Same for T

Source§

type Output = T

Should always be Self
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