pub trait QueryRefreshState {
// Required methods
fn get_refresh_state<Id: AsRef<[u8]>>(
&self,
entity_id: Id,
entity_kind: EntityKind,
) -> Result<Option<RefreshState>, StorageError>;
fn get_last_cursor<Id: AsRef<[u8]>>(
&self,
id: Id,
entity_kind: EntityKind,
) -> Result<Cursor, StorageError>;
fn get_last_cursor_for_ids<Id: AsRef<[u8]>>(
&self,
ids: &[Id],
entities: &[EntityKind],
) -> Result<HashMap<Vec<u8>, Cursor>, StorageError>;
fn update_cursor<Id: AsRef<[u8]>>(
&self,
entity_id: Id,
entity_kind: EntityKind,
cursor: Cursor,
) -> Result<bool, StorageError>;
// Provided methods
fn latest_cursor_for_id<Id: AsRef<[u8]>>(
&self,
entity_id: Id,
entities: &[EntityKind],
) -> Result<Cursor, StorageError> { ... }
fn get_remote_log_cursors(
&self,
conversation_ids: &[&[u8]],
) -> Result<HashMap<Vec<u8>, Cursor>, StorageError> { ... }
}Required Methods§
fn get_refresh_state<Id: AsRef<[u8]>>( &self, entity_id: Id, entity_kind: EntityKind, ) -> Result<Option<RefreshState>, StorageError>
Sourcefn get_last_cursor<Id: AsRef<[u8]>>(
&self,
id: Id,
entity_kind: EntityKind,
) -> Result<Cursor, StorageError>
fn get_last_cursor<Id: AsRef<[u8]>>( &self, id: Id, entity_kind: EntityKind, ) -> Result<Cursor, StorageError>
Read one ledger position. Create a zero position when it is absent.
Sourcefn get_last_cursor_for_ids<Id: AsRef<[u8]>>(
&self,
ids: &[Id],
entities: &[EntityKind],
) -> Result<HashMap<Vec<u8>, Cursor>, StorageError>
fn get_last_cursor_for_ids<Id: AsRef<[u8]>>( &self, ids: &[Id], entities: &[EntityKind], ) -> Result<HashMap<Vec<u8>, Cursor>, StorageError>
Return the minimum position across the requested kinds for each stored id. An absent kind has position zero. Ids with no rows are absent from the map.
Sourcefn update_cursor<Id: AsRef<[u8]>>(
&self,
entity_id: Id,
entity_kind: EntityKind,
cursor: Cursor,
) -> Result<bool, StorageError>
fn update_cursor<Id: AsRef<[u8]>>( &self, entity_id: Id, entity_kind: EntityKind, cursor: Cursor, ) -> Result<bool, StorageError>
Advance a ledger position only when the new position is greater.
Provided Methods§
fn latest_cursor_for_id<Id: AsRef<[u8]>>( &self, entity_id: Id, entities: &[EntityKind], ) -> Result<Cursor, StorageError>
fn get_remote_log_cursors( &self, conversation_ids: &[&[u8]], ) -> Result<HashMap<Vec<u8>, Cursor>, StorageError>
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.