HashFlatSetAdapt

Trait HashFlatSetAdapt 

Source
pub trait HashFlatSetAdapt:
    Clearable
    + Send
    + Sized
    + Sync
    + Touchable
    + 'static {
    type Entity: EntityAccessor + CtxTypeInfo + Send;
    type K: Clone + Eq + Hash + Send + Sync;
    type V: Clone + Eq + Hash + Into<u32> + Send + Sync + TryFrom<u32>;

    // Required methods
    fn adapt(
        id: &<Self::Entity as Entity>::Key,
        entity: &Self::Entity,
        out: &mut FxHashSet<(Option<<Self as HashFlatSetAdapt>::K>, <Self as HashFlatSetAdapt>::V)>,
    );
    fn index_var() -> CtxVar<HashFlatSetIndex<Self>>;

    // Provided methods
    fn apply_log(ctx: &mut Ctx, logs: &mut Logs) -> bool { ... }
    fn base_and_log<'a, 'b>(
        ctx: &'a Ctx,
        logs: &'b mut Logs,
        force_log: bool,
    ) -> BaseAndLog<'a, 'b, Self> { ... }
    fn get_or_init(ctx: &Ctx) -> BoxFuture<'_, Result<&HashFlatSetIndex<Self>>>
       where Ctx: AsRefAsync<<Self::Entity as EntityAccessor>::Tbl>,
             ProviderContainer: LoadAll<Self::Entity, (), <Self::Entity as EntityAccessor>::Tbl> { ... }
    fn get_or_init_sync<'a>(
        ctx: &'a Ctx,
        tbl: &'a <Self::Entity as EntityAccessor>::Tbl,
    ) -> &'a HashFlatSetIndex<Self> { ... }
    fn handle_clear(ctx: &mut Ctx) { ... }
    fn handle_removed<'a>(
        trx: &'a mut CtxTransaction<'_>,
        id: &'a <Self::Entity as Entity>::Key,
        entity: &'a Self::Entity,
    ) -> BoxFuture<'a, Result<()>> { ... }
    fn handle_upserted<'a>(
        trx: &'a mut CtxTransaction<'_>,
        id: &'a <Self::Entity as Entity>::Key,
        old: Option<&'a Self::Entity>,
    ) -> BoxFuture<'a, Result<()>> { ... }
    fn register() { ... }
    fn upsert_or_remove(
        base: &HashFlatSetIndex<Self>,
        log: &mut HashFlatSetIndexLog<Self::K, Self::V>,
        key: &<Self::Entity as Entity>::Key,
        new: Option<&Self::Entity>,
        old: Option<&Self::Entity>,
        old_set: &mut FxHashSet<(Option<<Self as HashFlatSetAdapt>::K>, <Self as HashFlatSetAdapt>::V)>,
        new_set: &mut FxHashSet<(Option<<Self as HashFlatSetAdapt>::K>, <Self as HashFlatSetAdapt>::V)>,
    ) { ... }
}

Required Associated Types§

Required Methods§

Source

fn adapt( id: &<Self::Entity as Entity>::Key, entity: &Self::Entity, out: &mut FxHashSet<(Option<<Self as HashFlatSetAdapt>::K>, <Self as HashFlatSetAdapt>::V)>, )

Source

fn index_var() -> CtxVar<HashFlatSetIndex<Self>>

Provided Methods§

Source

fn apply_log(ctx: &mut Ctx, logs: &mut Logs) -> bool

Source

fn base_and_log<'a, 'b>( ctx: &'a Ctx, logs: &'b mut Logs, force_log: bool, ) -> BaseAndLog<'a, 'b, Self>

Source

fn get_or_init(ctx: &Ctx) -> BoxFuture<'_, Result<&HashFlatSetIndex<Self>>>

Source

fn get_or_init_sync<'a>( ctx: &'a Ctx, tbl: &'a <Self::Entity as EntityAccessor>::Tbl, ) -> &'a HashFlatSetIndex<Self>

Source

fn handle_clear(ctx: &mut Ctx)

Source

fn handle_removed<'a>( trx: &'a mut CtxTransaction<'_>, id: &'a <Self::Entity as Entity>::Key, entity: &'a Self::Entity, ) -> BoxFuture<'a, Result<()>>

Source

fn handle_upserted<'a>( trx: &'a mut CtxTransaction<'_>, id: &'a <Self::Entity as Entity>::Key, old: Option<&'a Self::Entity>, ) -> BoxFuture<'a, Result<()>>

Source

fn register()

Source

fn upsert_or_remove( base: &HashFlatSetIndex<Self>, log: &mut HashFlatSetIndexLog<Self::K, Self::V>, key: &<Self::Entity as Entity>::Key, new: Option<&Self::Entity>, old: Option<&Self::Entity>, old_set: &mut FxHashSet<(Option<<Self as HashFlatSetAdapt>::K>, <Self as HashFlatSetAdapt>::V)>, new_set: &mut FxHashSet<(Option<<Self as HashFlatSetAdapt>::K>, <Self as HashFlatSetAdapt>::V)>, )

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.

Implementors§