forked from jmug/stoatchat
chore: add missing traits implementations to PermissionValue
This commit is contained in:
@@ -8,10 +8,18 @@ pub use server::*;
|
|||||||
pub use user::*;
|
pub use user::*;
|
||||||
|
|
||||||
/// Holds a permission value to manipulate.
|
/// Holds a permission value to manipulate.
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
|
||||||
pub struct PermissionValue(u64);
|
pub struct PermissionValue(u64);
|
||||||
|
|
||||||
impl PermissionValue {
|
impl PermissionValue {
|
||||||
|
pub fn from_raw(value: u64) -> Self {
|
||||||
|
Self(value)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn into_raw(self) -> u64 {
|
||||||
|
self.0
|
||||||
|
}
|
||||||
|
|
||||||
/// Apply a given override to this value
|
/// Apply a given override to this value
|
||||||
pub fn apply(&mut self, v: Override) {
|
pub fn apply(&mut self, v: Override) {
|
||||||
self.allow(v.allow);
|
self.allow(v.allow);
|
||||||
|
|||||||
Reference in New Issue
Block a user