cartel-pg 0.22.0

Async PostgreSQL driver for the dope runtime
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use crate::protocol::runtime::ready::storage;
use o3::depot;
use o3::depot::queue::links;

pub(super) struct Buckets<'a, 'd, const ID: u8>(pub(super) &'a storage::Block<'d, ID>);

// SAFETY: every accepted index projects one stable bucket hook.
unsafe impl<const ID: u8> depot::raw::Hooks for Buckets<'_, '_, ID> {
    unsafe fn hook_raw(&self, index: links::Index) -> &links::Hook {
        &unsafe { self.0.nodes().get_unchecked(index.get()) }.bucket
    }
}