pub struct IntentMachine {
pub store: ClientStore,
pub attempts: u32,
pub backoff_ms: Vec<u64>,
}Fields§
§store: ClientStore§attempts: u32§backoff_ms: Vec<u64>Implementations§
Source§impl IntentMachine
impl IntentMachine
pub fn new(store: ClientStore, attempts: u32, backoff_ms: Vec<u64>) -> Self
Sourcepub fn enqueue(&self, envelope: &Envelope) -> Result<bool>
pub fn enqueue(&self, envelope: &Envelope) -> Result<bool>
Queue one envelope under the id its row is keyed by.
A kind that may arrive without a key (a note) gets a fresh one from
stamp_op_id, and the stamped envelope is what the row stores and
replays, so the row’s op_id and its env_json never disagree.
pub fn enqueue_value(&self, op_id: &str, envelope: &Value) -> Result<bool>
pub fn pending(&self) -> Result<Vec<IntentRow>>
pub fn next_delay(&self, attempt: u32) -> Duration
pub fn attempt( &self, row: &IntentRow, response: Option<&ResBody>, ) -> Result<IntentResult>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for IntentMachine
impl RefUnwindSafe for IntentMachine
impl Send for IntentMachine
impl Sync for IntentMachine
impl Unpin for IntentMachine
impl UnsafeUnpin for IntentMachine
impl UnwindSafe for IntentMachine
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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