HOOKS: It there a way to use hooks in Rust?

Hi guys,

Do you know by any chance if there's a way to use hooks in Rust??
We wanna use elasticsearch indexing within "afterUpdate" / "afterCreate" in Diesel-Rust.

Thanks a lot for your help!

Maria

I think we need more info. Can you link some references for your terms: "hook", "afterUpdate", etc?

2 Likes

Like, the design pattern of callbacks? Sure, you could store callbacks in a Vec<Box<dyn Fn(&InputStuff)>> (or FnMut, or a custom trait). But it sounds like you might be referring to something more domain-specifc?