Skip to main content

EngineBuilder

Struct EngineBuilder 

Source
pub struct EngineBuilder<S, C = NoCache> { /* private fields */ }
Expand description

Builder for Engine.

Implementations§

Source§

impl<S> EngineBuilder<S, NoCache>

Source

pub fn new(store: S) -> Self

Creates a new builder with default configuration.

Source§

impl<S, C> EngineBuilder<S, C>

Source

pub fn enable_role_hierarchy(self, on: bool) -> Self

Enables or disables role inheritance.

Source

pub fn enable_wildcard(self, on: bool) -> Self

Enables or disables wildcard permission matching.

Source

pub fn enable_super_admin(self, on: bool) -> Self

Enables or disables super-admin short-circuit checks.

Source

pub fn max_inherit_depth(self, depth: usize) -> Self

Sets maximum inheritance depth.

Source

pub fn permission_normalize(self, on: bool) -> Self

Enables or disables permission normalization for matching.

Source

pub fn cache<C2: Cache>(self, cache: C2) -> EngineBuilder<S, C2>

Sets the cache implementation.

Source

pub fn build(self) -> Engine<S, C>

Builds the engine.

Auto Trait Implementations§

§

impl<S, C> Freeze for EngineBuilder<S, C>
where S: Freeze, C: Freeze,

§

impl<S, C> RefUnwindSafe for EngineBuilder<S, C>

§

impl<S, C> Send for EngineBuilder<S, C>
where S: Send, C: Send,

§

impl<S, C> Sync for EngineBuilder<S, C>
where S: Sync, C: Sync,

§

impl<S, C> Unpin for EngineBuilder<S, C>
where S: Unpin, C: Unpin,

§

impl<S, C> UnsafeUnpin for EngineBuilder<S, C>
where S: UnsafeUnpin, C: UnsafeUnpin,

§

impl<S, C> UnwindSafe for EngineBuilder<S, C>
where S: UnwindSafe, C: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.