pub trait OutgoingIndexStore {
type Error: Error + Send + Sync + 'static;
// Required methods
fn load_outgoing_index(
&self,
channel_id: &ChannelId,
epoch: u32,
) -> Result<Option<u64>, Self::Error>;
fn save_outgoing_index(
&mut self,
channel_id: &ChannelId,
epoch: u32,
index: u64,
) -> Result<(), Self::Error>;
fn delete_outgoing_index(
&mut self,
channel_id: &ChannelId,
epoch: u32,
) -> Result<(), Self::Error>;
fn iter_outgoing_indices(
&self,
) -> Result<impl Iterator<Item = (ChannelId, u32)>, Self::Error>;
}Expand description
Allows loading and saving outgoing ticket indices.
Required Associated Types§
Required Methods§
Sourcefn load_outgoing_index(
&self,
channel_id: &ChannelId,
epoch: u32,
) -> Result<Option<u64>, Self::Error>
fn load_outgoing_index( &self, channel_id: &ChannelId, epoch: u32, ) -> Result<Option<u64>, Self::Error>
Loads the last used outgoing ticket index for the given channel and epoch.
If the index is not found, returns Ok(None).
Sourcefn save_outgoing_index(
&mut self,
channel_id: &ChannelId,
epoch: u32,
index: u64,
) -> Result<(), Self::Error>
fn save_outgoing_index( &mut self, channel_id: &ChannelId, epoch: u32, index: u64, ) -> Result<(), Self::Error>
Saves the last used outgoing ticket index for the given channel and epoch.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.