#[repr(u8)]
pub enum PlayerRole {
    Default,
    Admin,
    SuperAdmin,
}
Expand description

Enum for the different roles that a player could have used to determine their permissions to access different server functionality

Variants§

§

Default

The default no extra permissions level

§

Admin

Administrator role which can be added and removed by super admin.

§

SuperAdmin

Super admin role which is created on startup and used to manage other user roles

Trait Implementations§

source§

impl ActiveEnum for PlayerRole

§

type Value = u8

Define the Rust type that each enum variant represents.
§

type ValueVec = Vec<u8, Global>

Define the enum value in Vector type.
source§

fn name() -> DynIden

Get the name of enum
source§

fn to_value(&self) -> Self::Value

Convert enum variant into the corresponding value.
source§

fn try_from_value(v: &Self::Value) -> Result<Self, DbErr>

Try to convert the corresponding value into enum variant.
source§

fn db_type() -> ColumnDef

Get the database column definition of this active enum.
source§

fn into_value(self) -> Self::Value

Convert an owned enum variant into the corresponding value.
source§

fn as_enum(&self) -> SimpleExpr

Construct a enum expression with casting
source§

fn values() -> Vec<Self::Value, Global>

Get the name of all enum variants
source§

impl Clone for PlayerRole

source§

fn clone(&self) -> PlayerRole

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PlayerRole

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for PlayerRole

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for PlayerRole

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Into<Value> for PlayerRole

source§

fn into(self) -> Value

Converts this type into the (usually inferred) input type.
source§

impl IntoEnumIterator for PlayerRole

§

type Iterator = PlayerRoleIter

source§

fn iter() -> PlayerRoleIter

source§

impl Nullable for PlayerRole

source§

fn null() -> Value

source§

impl Ord for PlayerRole

source§

fn cmp(&self, other: &PlayerRole) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<PlayerRole> for PlayerRole

source§

fn eq(&self, other: &PlayerRole) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<PlayerRole> for PlayerRole

source§

fn partial_cmp(&self, other: &PlayerRole) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Serialize for PlayerRole

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl TryGetable for PlayerRole

source§

fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>

Get a value from the query result with an ColIdx
source§

fn try_get(res: &QueryResult, pre: &str, col: &str) -> Result<Self, TryGetError>

Get a value from the query result with prefixed column name
source§

fn try_get_by_index( res: &QueryResult, index: usize ) -> Result<Self, TryGetError>

Get a value from the query result based on the order in the select expressions
source§

impl ValueType for PlayerRole

source§

fn try_from(v: Value) -> Result<Self, ValueTypeErr>

source§

fn type_name() -> String

source§

fn array_type() -> ArrayType

source§

fn column_type() -> ColumnType

§

fn unwrap(v: Value) -> Self

§

fn expect(v: Value, msg: &str) -> Self

source§

impl Eq for PlayerRole

source§

impl StructuralEq for PlayerRole

source§

impl StructuralPartialEq for PlayerRole

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<V> FromValueTuple for Vwhere V: Into<Value> + ValueType,

§

fn from_value_tuple<I>(i: I) -> Vwhere I: IntoValueTuple,

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

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

const: unstable · 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.

§

impl<V> IntoValueTuple for Vwhere V: Into<Value>,

§

fn into_value_tuple(self) -> ValueTuple

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

impl<T> TryFromU64 for Twhere T: ActiveEnum,

source§

fn try_from_u64(_: u64) -> Result<T, DbErr>

The method to convert the type to a u64
source§

impl<T> TryGetableMany for Twhere T: TryGetable,

source§

fn try_get_many( res: &QueryResult, pre: &str, cols: &[String] ) -> Result<T, TryGetError>

Get a tuple value from the query result with prefixed column name
source§

fn try_get_many_by_index(res: &QueryResult) -> Result<T, TryGetError>

Get a tuple value from the query result based on the order in the select expressions
source§

fn find_by_statement<C>( stmt: Statement ) -> SelectorRaw<SelectGetableValue<Self, C>>where C: IntoEnumIterator + Iden,

source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,