[][src]Struct legion::world::Permissions

pub struct Permissions<T: PartialEq> { /* fields omitted */ }

Describes read and write access to resources.

Implementations

impl<T: PartialEq> Permissions<T>[src]

pub fn new() -> Self[src]

Constructs a new empty permissions set.

pub fn push(&mut self, item: T)[src]

Adds a resource to the permissions set as both readable and writable.

pub fn push_read(&mut self, item: T)[src]

Adds a resource to the permissions set as readable.

pub fn push_write(&mut self, item: T)[src]

Adds a resource to the permissions set as writable.

pub fn remove(&mut self, item: &T)[src]

Removes a resource from the permissions set.

pub fn remove_read(&mut self, item: &T)[src]

Removes read access to a resource from the permissions set.

pub fn remove_write(&mut self, item: &T)[src]

Removes write access to a resource from the permissions set.

pub fn add(&mut self, other: Self)[src]

Adds all of the permissions contained in the given set to this permission set.

pub fn subtract(&mut self, other: &Self)[src]

Subtracts all of the permissions contained in the given set from this permission set.

pub fn reads(&self) -> &[T][src]

Gets a slice of resources which are afforded read access.

pub fn writes(&self) -> &[T][src]

Gets a slice of resources which are afforded write access.

pub fn reads_only(&self) -> &[T][src]

Gets a slice of resources which are afforded read access but not write access.

pub fn writes_only(&self) -> &[T][src]

Gets a slice of resources which are afforded write access but not read access.

pub fn readwrite(&self) -> &[T][src]

Gets a slice of resources which are afforded both read and write access.

pub fn is_superset(&self, other: &Self) -> bool[src]

Returns true if all of the permissions in the given set are contained in this set.

pub fn is_disjoint(&self, other: &Self) -> bool[src]

Returns true if none of the permissions in the given set are contained in this set.

Trait Implementations

impl<T: Clone + PartialEq> Clone for Permissions<T>[src]

impl<T: PartialEq + Debug> Debug for Permissions<T>[src]

impl<T: PartialEq> Default for Permissions<T>[src]

impl<T: PartialEq + Display> Display for Permissions<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Permissions<T> where
    T: RefUnwindSafe

impl<T> Send for Permissions<T> where
    T: Send

impl<T> Sync for Permissions<T> where
    T: Sync

impl<T> Unpin for Permissions<T> where
    T: Unpin

impl<T> UnwindSafe for Permissions<T> where
    T: RefUnwindSafe + UnwindSafe

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> Downcast for T where
    T: Any
[src]

impl<T> DowncastSync for T where
    T: Send + Sync + Any
[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> ToString for T where
    T: Display + ?Sized
[src]

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>,