pub fn new(m: Model, a: A) -> Self {
        let m = m;
        let fm = load_function_map();
        let eft = Box::new(DefaultEffector::default());
        let rm = Box::new(DefaultRoleManager::new(10));

        let mut e = Self {
            model: m,
            adapter: a,
            fm,
            eft,
            rm,
            auto_save: true,
            auto_build_role_links: true,
        };
        // TODO: check filtered adapter, match over a implementor?
        e.load_policy().unwrap();
        e
    }
/// Enforcer::new creates an enforcer via file or DB.
:new creates an enforcer via file or DB.
: new creates an enforcer via file or DB .
pub fn new(m: Model, a: A) -> Self {
        let m = m;
        let fm = load_function_map();
        let eft = Box::new(DefaultEffector::default());
        let rm = Box::new(DefaultRoleManager::new(10));
        let mut e = Self {
            model: m,
            adapter: a,
            fm,
            eft,
            rm,
            auto_save: true,
            auto_build_role_links: true,
        };
        // TODO: check filtered adapter, match over a implementor?
        e.load_policy().unwrap();
        e
    }
pub fn new ( m : Model , a : A ) -> Self { let m = m ; let fm = load_function_map ( ) ; let eft = Box :: new ( DefaultEffector :: default ( ) ) ; let rm = Box :: new ( DefaultRoleManager :: new ( 10 ) ) ; let mut e = Self { model : m , adapter : a , fm , eft , rm , auto_save : true , auto_build_role_links : true , } ; // TODO: check filtered adapter, match over a implementor? e . load_policy ( ) . unwrap ( ) ; e }
Enforcer::new creates an enforcer via file or DB.
Enforcer :: new creates an enforcer via file or DB .
m
Model
a
A
m
Model
a
A