Skip to main content

MCardSyncEngine

Struct MCardSyncEngine 

Source
pub struct MCardSyncEngine {
    pub node_id: String,
    pub is_disposed: bool,
    pub records: BTreeMap<String, MCardRecord>,
    pub handle_markings: BTreeMap<String, BTreeMap<String, i64>>,
    pub handle_heads: BTreeMap<String, Option<String>>,
    pub handle_clocks: BTreeMap<String, BTreeMap<String, u64>>,
    pub transitions: Vec<TransitionPayload>,
    pub committed_transfers: BTreeSet<String>,
    pub outbox: BTreeMap<String, SyncOutboxEntry>,
    pub transfer_marking: BTreeMap<String, i64>,
    pub transport: Option<Box<dyn SyncFrameTransport>>,
    pub outbox_port: Option<Box<dyn SyncOutboxPort>>,
}

Fields§

§node_id: String§is_disposed: bool§records: BTreeMap<String, MCardRecord>§handle_markings: BTreeMap<String, BTreeMap<String, i64>>§handle_heads: BTreeMap<String, Option<String>>§handle_clocks: BTreeMap<String, BTreeMap<String, u64>>§transitions: Vec<TransitionPayload>§committed_transfers: BTreeSet<String>§outbox: BTreeMap<String, SyncOutboxEntry>§transfer_marking: BTreeMap<String, i64>§transport: Option<Box<dyn SyncFrameTransport>>§outbox_port: Option<Box<dyn SyncOutboxPort>>

Implementations§

Source§

impl MCardSyncEngine

Source

pub fn enqueue_transfer( &mut self, target_node_id: &str, records: Vec<RecordFrame>, transitions: Vec<TransitionPayload>, disambiguator: &str, ) -> Result<SyncOutboxEntry, SyncContractError>

Source

pub fn flush_outbox( &mut self, ) -> Result<Vec<SyncOutboxEntry>, SyncContractError>

Flush eligible outbox entries through the transport. The exact durable entry must exist before any network I/O; transport errors are treated as transient and keep the entry retryable.

Source

pub fn retry_transfer(&mut self, delivery_id: &str) -> RetryOutcome

Source§

impl MCardSyncEngine

Source

pub fn new(node_id: &str) -> Self

Source

pub fn new_with_ports( node_id: &str, transport: Option<Box<dyn SyncFrameTransport>>, outbox_port: Option<Box<dyn SyncOutboxPort>>, ) -> Self

Source

pub fn default_lifecycle_marking() -> BTreeMap<String, i64>

Source

pub fn admit_record_frame( &mut self, frame: &RecordFrame, ) -> Result<(String, bool), (String, String)>

Source

pub fn apply_transition( &mut self, transition_id: &str, payload: &TransitionPayload, record_frames: &[RecordFrame], ) -> TransitionGateResult

Source

pub fn receive_attempt( &mut self, attempt: &TransferAttempt, records: &[RecordFrame], ) -> ReceiveOutcome

Source

pub fn receive_transfer( &mut self, transfer_id: &str, records: &[RecordFrame], ) -> Result<bool, (String, String)>

Legacy inbound API preserved for backward compatibility. Prefer receive_attempt for full declared-hash and transition validation.

Source

pub fn dispose(&mut self)

Trait Implementations§

Source§

impl Drop for MCardSyncEngine

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more