Struct garage_model::index_counter::IndexCounter
source · pub struct IndexCounter<T: CountedItem> {
pub table: Arc<Table<CounterTable<T>, TableShardedReplication>>,
/* private fields */
}
Fields
table: Arc<Table<CounterTable<T>, TableShardedReplication>>
Implementations
sourceimpl<T: CountedItem> IndexCounter<T>
impl<T: CountedItem> IndexCounter<T>
pub fn new(
system: Arc<System>,
replication: TableShardedReplication,
db: &Db
) -> Arc<Self>
pub fn count(
&self,
tx: &mut Transaction<'_>,
old: Option<&T>,
new: Option<&T>
) -> TxResult<(), Error>
pub fn offline_recount_all<TS, TR>(
&self,
counted_table: &Arc<Table<TS, TR>>
) -> Result<(), Error>where
TS: TableSchema<E = T>,
TR: TableReplication,
Auto Trait Implementations
impl<T> !RefUnwindSafe for IndexCounter<T>
impl<T> Send for IndexCounter<T>
impl<T> Sync for IndexCounter<T>
impl<T> Unpin for IndexCounter<T>
impl<T> !UnwindSafe for IndexCounter<T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more