Struct lrau::permission::Permission[][src]

pub struct Permission {
    pub path: String,
    pub auth: bool,
    pub mut: bool,
}

The permission struct stores an individual permission. This contains information about a user accessing certain areas of a program.

It can be configured in toml like below: First specify an individual element in a permissions array. In this you need to specify a path path, and wether the user has permission auth. Then you can specify mutability mut.

# Create an array element
[[permissions]]
# Specify the path
path = "/contacts"
# Specify the authentication
auth = true
# Specify if they can mutate the contacts
mut = true

This creates a permission in the /contacts path, where the user can both read and mutate it.

Fields

path: Stringauth: boolmut: bool

Implementations

impl Permission[src]

pub fn new(path: String, auth: bool, mut: bool) -> Self[src]

Creates a new permission.

Trait Implementations

impl Clone for Permission[src]

impl Debug for Permission[src]

impl Eq for Permission[src]

impl Hash for Permission[src]

impl Ord for Permission[src]

impl PartialEq<Permission> for Permission[src]

impl PartialOrd<Permission> for Permission[src]

impl StructuralEq for Permission[src]

impl StructuralPartialEq for Permission[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,