later 0.0.48

Distributed Background jobs manager and runner for Rust
#[derive(Clone, Debug, Eq, PartialEq)]
/// One member returned from an ordered storage range.
pub struct RangeItem {
    /// Stable position used as the exclusive cursor for the next page.
    pub cursor: i64,
    /// Opaque member bytes.
    pub value: Vec<u8>,
}

#[derive(Clone, Copy, Debug, Eq, PartialEq)]
/// Direction used to read an ordered storage range.
pub enum RangeOrder {
    /// Read from the lowest cursor to the highest cursor.
    OldestFirst,
    /// Read from the highest cursor to the lowest cursor.
    NewestFirst,
}

#[derive(Clone, Debug, Eq, PartialEq)]
/// A bounded page from an ordered storage range.
pub struct RangePage {
    /// Members in the requested order, containing at most the requested limit.
    pub items: Vec<RangeItem>,
    /// Exclusive cursor to use for another page.
    ///
    /// `None` means there are no later members. A full final page may still
    /// return a cursor, followed by an empty page with no cursor.
    pub next_cursor: Option<i64>,
}

#[derive(Clone, Debug, Eq, PartialEq)]
/// One mutation in an atomic [`super::Storage::apply`] batch.
pub enum StorageOperation {
    /// Sets a key to a byte value and clears its previous expiry.
    Set {
        /// Key to set.
        key: String,
        /// New opaque value.
        value: Vec<u8>,
    },
    /// Deletes a key if it exists.
    Delete {
        /// Key to delete.
        key: String,
    },
    /// Applies a time-to-live to an existing key.
    Expire {
        /// Key to expire.
        key: String,
        /// Time-to-live from the operation's commit time.
        ttl_seconds: usize,
    },
    /// Adds a unique member to an ordered range.
    RangeAdd {
        /// Range key.
        key: String,
        /// Opaque member bytes.
        value: Vec<u8>,
    },
    /// Removes a member from an ordered range.
    RangeRemove {
        /// Range key.
        key: String,
        /// Opaque member bytes to remove.
        value: Vec<u8>,
    },
    /// Applies a time-to-live to an existing range member.
    RangeExpire {
        /// Range key.
        key: String,
        /// Opaque member bytes to expire.
        value: Vec<u8>,
        /// Time-to-live from the operation's commit time.
        ttl_seconds: usize,
    },
    /// Removes every member and cursor belonging to a range.
    RangeClear {
        /// Range key to clear.
        key: String,
    },
}