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

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