pub struct Outbox { /* private fields */ }Implementations§
Source§impl Outbox
impl Outbox
pub fn at(data_dir: &Path) -> Self
Sourcepub fn enqueue(
&self,
channel: &str,
payload: Value,
now: UtcDateTime,
) -> Result<String, CloudError>
pub fn enqueue( &self, channel: &str, payload: Value, now: UtcDateTime, ) -> Result<String, CloudError>
Queue payload on channel; returns the item id.
Sourcepub fn list(&self, channel: &str) -> Vec<OutboxItem>
pub fn list(&self, channel: &str) -> Vec<OutboxItem>
Pending items of channel, oldest first. Damaged files are moved aside.
pub fn remove(&self, item: &OutboxItem) -> Result<(), CloudError>
Sourcepub fn update(&self, item: &OutboxItem) -> Result<(), CloudError>
pub fn update(&self, item: &OutboxItem) -> Result<(), CloudError>
Replace an item (e.g. after a rebase) keeping its id.
Sourcepub fn retry_later(
&self,
item: &mut OutboxItem,
error: &str,
retry_after: Option<u64>,
now: UtcDateTime,
) -> Result<(), CloudError>
pub fn retry_later( &self, item: &mut OutboxItem, error: &str, retry_after: Option<u64>, now: UtcDateTime, ) -> Result<(), CloudError>
Record a transient failure: exponential backoff 30 s → 1 h with
jitter, or Cloud’ Retry-After when given.
Sourcepub fn hold_for_policy(
&self,
item: &mut OutboxItem,
error: &str,
retry_after: Option<u64>,
now: UtcDateTime,
) -> Result<(), CloudError>
pub fn hold_for_policy( &self, item: &mut OutboxItem, error: &str, retry_after: Option<u64>, now: UtcDateTime, ) -> Result<(), CloudError>
Self::retry_later for a policy refusal: the item waits
retry_after (or the backoff), or until a newer policy is in force.
Sourcepub fn release_policy_holds(&self) -> usize
pub fn release_policy_holds(&self) -> usize
A newer policy is in force: every item waiting on a policy refusal is due again, on every channel; other waits stay. Returns how many.
Sourcepub fn fail(&self, item: &mut OutboxItem, error: &str) -> Result<(), CloudError>
pub fn fail(&self, item: &mut OutboxItem, error: &str) -> Result<(), CloudError>
Cloud refused the item for good: keep it visible under failed/.
pub fn failed(&self, channel: &str) -> Vec<OutboxItem>
pub fn depth(&self, channel: &str) -> OutboxDepth
Auto Trait Implementations§
impl Forget for Outbox
impl Freeze for Outbox
impl Move for Outbox
impl RefUnwindSafe for Outbox
impl Send for Outbox
impl Sync for Outbox
impl Unpin for Outbox
impl UnsafeUnpin for Outbox
impl UnwindSafe for Outbox
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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