[][src]Struct casbin::Model

pub struct Model { /* fields omitted */ }

Methods

impl Model[src]

pub fn from_file<P: AsRef<Path>>(p: P) -> Result<Self>[src]

pub fn from_str(&mut self, s: &str) -> Result<Self>[src]

pub fn add_def(&mut self, sec: &str, key: &str, value: &str) -> bool[src]

pub fn get_model(&self) -> &HashMap<String, HashMap<String, Assertion>>[src]

pub fn get_mut_model(
    &mut self
) -> &mut HashMap<String, HashMap<String, Assertion>>
[src]

pub fn add_policy(&mut self, sec: &str, ptype: &str, rule: Vec<&str>) -> bool[src]

pub fn get_policy(&self, sec: &str, ptype: &str) -> Vec<Vec<String>>[src]

pub fn get_filtered_policy(
    &self,
    sec: &str,
    ptype: &str,
    field_index: usize,
    field_values: Vec<&str>
) -> Vec<Vec<String>>
[src]

pub fn has_policy(&self, sec: &str, ptype: &str, rule: Vec<&str>) -> bool[src]

pub fn get_values_for_field_in_policy(
    &self,
    sec: &str,
    ptype: &str,
    field_index: usize
) -> Vec<String>
[src]

pub fn remove_policy(&mut self, sec: &str, ptype: &str, rule: Vec<&str>) -> bool[src]

pub fn clear_policy(&mut self)[src]

pub fn remove_filtered_policy(
    &mut self,
    sec: &str,
    ptype: &str,
    field_index: usize,
    field_values: Vec<&str>
) -> bool
[src]

Trait Implementations

impl Clone for Model[src]

impl Default for Model[src]

Auto Trait Implementations

impl RefUnwindSafe for Model

impl Send for Model

impl Sync for Model

impl Unpin for Model

impl UnwindSafe for Model

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Any for T where
    T: Clone + Any + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.