pub fn register_after_rel_update(
        &mut self,
        rel_names: Vec<String>,
        f: AfterRelEventFunc<RequestCtx>,
    ) {
        for rel_name in rel_names {
            if let Some(handlers) = self.after_rel_update_handlers.get_mut(&rel_name) {
                handlers.push(f);
            } else {
                self.after_rel_update_handlers.insert(rel_name, vec![f]);
            }
        }
    }
/// Registers an event handler `f` to be called after a rel is updated.
///
/// # Examples
///
/// ```rust
/// # use warpgrapher::engine::events::{EventHandlerBag, EventFacade};
/// # use warpgrapher::Error;
/// # use warpgrapher::engine::value::Value;
/// # use warpgrapher::engine::objects::Rel;
/// # use warpgrapher::juniper::BoxFuture;
///
/// fn after_project_owner_update(rels: Vec<Rel<()>>, ef: EventFacade<()>) ->
///   BoxFuture<Result<Vec<Rel<()>>, Error>> {
///     Box::pin(async move {
///         // Normally work would be done here, resulting in some new value.
///         Ok(rels)
///     })
/// }
///
/// let mut handlers = EventHandlerBag::<()>::new();
/// handlers.register_after_rel_update(vec!["ProjectOwnerRel".to_string()],
///     after_project_owner_update);
/// ```
Registers an event handler `f` to be called after a rel is updated.
Registers an event handler ` f ` to be called after a rel is updated .
pub fn register_after_rel_update(
        &mut self,
        rel_names: Vec<String>,
        f: AfterRelEventFunc<RequestCtx>,
    ) {
        for rel_name in rel_names {
            if let Some(handlers) = self.after_rel_update_handlers.get_mut(&rel_name) {
                handlers.push(f);
            } else {
                self.after_rel_update_handlers.insert(rel_name, vec![f]);
            }
        }
    }
pub fn register_after_rel_update ( & mut self , rel_names : Vec < String > , f : AfterRelEventFunc < RequestCtx > , ) { for rel_name in rel_names { if let Some ( handlers ) = self . after_rel_update_handlers . get_mut ( & rel_name ) { handlers . push ( f ) ; } else { self . after_rel_update_handlers . insert ( rel_name , vec ! [ f ] ) ; } } }
Registers an event handler `f` to be called after a rel is updated.
Registers an event handler ` f ` to be called after a rel is updated .
&mut self
rel_names
Vec<String>
f
AfterRelEventFunc<RequestCtx>
&mut self
rel_names
Vec<String>
f
AfterRelEventFunc<RequestCtx>
examples
None
use warpgrapher::engine::events::{eventhandlerbag, eventfacade};
None
use warpgrapher::error;
None
use warpgrapher::engine::value::value;
None
use warpgrapher::engine::objects::rel;
None
use warpgrapher::juniper::boxfuture;
fn after_project_owner_update(rels: Vec>, ef: EventFacade<()>) ->
BoxFuture>, Error>> {
Box::pin(async move {
Normally work would be done here, resulting in some new value.

let mut handlers = EventHandlerBag::<()>::new();
handlers.register_after_rel_update(vec!["ProjectOwnerRel".to_string()],
after_project_owner_update);
```
fn after_project_owner_update ( rels : Vec > ef : EventFacade< () > ) - > BoxFuture > Error >> { Box :: pin ( async move { Normally work would be done here resulting in some new value . let mut handlers = EventHandlerBag :: < () > :: new () ; handlers . register_after_rel_update ( vec! [ " ProjectOwnerRel " . to_string () ] after_project_owner_update ) ; ` ` `