pub struct FunnelRepo<'a> { /* private fields */ }Expand description
Persists the per-install id and the once-per-install claim state.
Implementations§
Source§impl<'a> FunnelRepo<'a>
impl<'a> FunnelRepo<'a>
pub fn new(store: &'a CacheStore) -> Self
Sourcepub fn get_or_create_install_id(&self, now_ms: u64) -> RovenueResult<String>
pub fn get_or_create_install_id(&self, now_ms: u64) -> RovenueResult<String>
Returns the persisted install_id, generating + storing it on first call.
Sourcepub fn set_claim_state(
&self,
install_id: &str,
state: &str,
subscriber_id: Option<&str>,
now_ms: u64,
) -> RovenueResult<()>
pub fn set_claim_state( &self, install_id: &str, state: &str, subscriber_id: Option<&str>, now_ms: u64, ) -> RovenueResult<()>
Upserts the claim state for an install (pending/claimed/failed).
Sourcepub fn claim_state(&self, install_id: &str) -> RovenueResult<Option<String>>
pub fn claim_state(&self, install_id: &str) -> RovenueResult<Option<String>>
Current claim state for an install, or None if never attempted.
Auto Trait Implementations§
impl<'a> Freeze for FunnelRepo<'a>
impl<'a> RefUnwindSafe for FunnelRepo<'a>
impl<'a> Send for FunnelRepo<'a>
impl<'a> Sync for FunnelRepo<'a>
impl<'a> Unpin for FunnelRepo<'a>
impl<'a> UnwindSafe for FunnelRepo<'a>
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