pub struct Role {
uuid: Uuid,
guild_uuid: Uuid,
name: String,
color: i32,
is_above: Option<Uuid>,
pub permissions: i64,
}
Fields§
§uuid: Uuid
§guild_uuid: Uuid
§name: String
§color: i32
§is_above: Option<Uuid>
§permissions: i64
Implementations§
Source§impl Role
impl Role
pub async fn fetch_all( conn: &mut Object<AsyncDieselConnectionManager<AsyncPgConnection>>, guild_uuid: Uuid, ) -> Result<Vec<Self>, Error>
pub async fn fetch_from_member( data: &Data, member_uuid: Uuid, ) -> Result<Vec<Self>, Error>
pub async fn fetch_one( conn: &mut Object<AsyncDieselConnectionManager<AsyncPgConnection>>, role_uuid: Uuid, ) -> Result<Self, Error>
pub async fn fetch_permissions(&self) -> Vec<Permissions>
pub async fn new( conn: &mut Object<AsyncDieselConnectionManager<AsyncPgConnection>>, guild_uuid: Uuid, name: String, ) -> Result<Self, Error>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Role
impl<'de> Deserialize<'de> for Role
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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<'insert> Insertable<table> for &'insert Role
impl<'insert> Insertable<table> for &'insert Role
Source§type Values = <(Option<Grouped<Eq<uuid, <&'insert Uuid as AsExpression<<uuid as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<guild_uuid, <&'insert Uuid as AsExpression<<guild_uuid as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<name, <&'insert String as AsExpression<<name as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<color, <&'insert i32 as AsExpression<<color as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<is_above, <&'insert Uuid as AsExpression<<is_above as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<permissions, <&'insert i64 as AsExpression<<permissions as Expression>::SqlType>>::Expression>>>) as Insertable<table>>::Values
type Values = <(Option<Grouped<Eq<uuid, <&'insert Uuid as AsExpression<<uuid as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<guild_uuid, <&'insert Uuid as AsExpression<<guild_uuid as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<name, <&'insert String as AsExpression<<name as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<color, <&'insert i32 as AsExpression<<color as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<is_above, <&'insert Uuid as AsExpression<<is_above as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<permissions, <&'insert i64 as AsExpression<<permissions as Expression>::SqlType>>::Expression>>>) as Insertable<table>>::Values
The
VALUES
clause to insert these records Read moreSource§fn values(
self,
) -> <(Option<Eq<uuid, &'insert Uuid>>, Option<Eq<guild_uuid, &'insert Uuid>>, Option<Eq<name, &'insert String>>, Option<Eq<color, &'insert i32>>, Option<Eq<is_above, &'insert Uuid>>, Option<Eq<permissions, &'insert i64>>) as Insertable<table>>::Values
fn values( self, ) -> <(Option<Eq<uuid, &'insert Uuid>>, Option<Eq<guild_uuid, &'insert Uuid>>, Option<Eq<name, &'insert String>>, Option<Eq<color, &'insert i32>>, Option<Eq<is_above, &'insert Uuid>>, Option<Eq<permissions, &'insert i64>>) as Insertable<table>>::Values
Construct
Self::Values
Read more§fn insert_into(self, table: T) -> InsertStatement<T, Self::Values>where
T: Table,
Self: Sized,
fn insert_into(self, table: T) -> InsertStatement<T, Self::Values>where
T: Table,
Self: Sized,
Insert
self
into a given table. Read moreSource§impl Insertable<table> for Role
impl Insertable<table> for Role
Source§type Values = <(Option<Grouped<Eq<uuid, <Uuid as AsExpression<<uuid as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<guild_uuid, <Uuid as AsExpression<<guild_uuid as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<name, <String as AsExpression<<name as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<color, <i32 as AsExpression<<color as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<is_above, <Uuid as AsExpression<<is_above as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<permissions, <i64 as AsExpression<<permissions as Expression>::SqlType>>::Expression>>>) as Insertable<table>>::Values
type Values = <(Option<Grouped<Eq<uuid, <Uuid as AsExpression<<uuid as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<guild_uuid, <Uuid as AsExpression<<guild_uuid as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<name, <String as AsExpression<<name as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<color, <i32 as AsExpression<<color as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<is_above, <Uuid as AsExpression<<is_above as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<permissions, <i64 as AsExpression<<permissions as Expression>::SqlType>>::Expression>>>) as Insertable<table>>::Values
The
VALUES
clause to insert these records Read moreSource§fn values(
self,
) -> <(Option<Eq<uuid, Uuid>>, Option<Eq<guild_uuid, Uuid>>, Option<Eq<name, String>>, Option<Eq<color, i32>>, Option<Eq<is_above, Uuid>>, Option<Eq<permissions, i64>>) as Insertable<table>>::Values
fn values( self, ) -> <(Option<Eq<uuid, Uuid>>, Option<Eq<guild_uuid, Uuid>>, Option<Eq<name, String>>, Option<Eq<color, i32>>, Option<Eq<is_above, Uuid>>, Option<Eq<permissions, i64>>) as Insertable<table>>::Values
Construct
Self::Values
Read more§fn insert_into(self, table: T) -> InsertStatement<T, Self::Values>where
T: Table,
Self: Sized,
fn insert_into(self, table: T) -> InsertStatement<T, Self::Values>where
T: Table,
Self: Sized,
Insert
self
into a given table. Read moreSource§impl<__DB: Backend, __ST0, __ST1, __ST2, __ST3, __ST4, __ST5> Queryable<(__ST0, __ST1, __ST2, __ST3, __ST4, __ST5), __DB> for Role
impl<__DB: Backend, __ST0, __ST1, __ST2, __ST3, __ST4, __ST5> Queryable<(__ST0, __ST1, __ST2, __ST3, __ST4, __ST5), __DB> for Role
Source§impl<__DB: Backend> Selectable<__DB> for Role
impl<__DB: Backend> Selectable<__DB> for Role
Source§type SelectExpression = (uuid, guild_uuid, name, color, is_above, permissions)
type SelectExpression = (uuid, guild_uuid, name, color, is_above, permissions)
The expression you’d like to select. Read more
Source§fn construct_selection() -> Self::SelectExpression
fn construct_selection() -> Self::SelectExpression
Construct an instance of the expression
impl UndecoratedInsertRecord<table> for Role
Auto Trait Implementations§
impl Freeze for Role
impl RefUnwindSafe for Role
impl Send for Role
impl Sync for Role
impl Unpin for Role
impl UnwindSafe for Role
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Chain<T> for T
impl<T> Chain<T> for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoSql for T
impl<T> IntoSql for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T, Conn> RunQueryDsl<Conn> for T
impl<T, Conn> RunQueryDsl<Conn> for T
§fn execute<'conn, 'query>(
self,
conn: &'conn mut Conn,
) -> <Conn as AsyncConnection>::ExecuteFuture<'conn, 'query>where
Conn: AsyncConnection + Send,
Self: ExecuteDsl<Conn> + 'query,
fn execute<'conn, 'query>(
self,
conn: &'conn mut Conn,
) -> <Conn as AsyncConnection>::ExecuteFuture<'conn, 'query>where
Conn: AsyncConnection + Send,
Self: ExecuteDsl<Conn> + 'query,
Executes the given command, returning the number of rows affected. Read more
§fn load<'query, 'conn, U>(
self,
conn: &'conn mut Conn,
) -> AndThen<Self::LoadFuture<'conn>, TryCollect<Self::Stream<'conn>, Vec<U>>, fn(_: Self::Stream<'conn>) -> TryCollect<Self::Stream<'conn>, Vec<U>>>where
U: Send,
Conn: AsyncConnection,
Self: LoadQuery<'query, Conn, U> + 'query,
fn load<'query, 'conn, U>(
self,
conn: &'conn mut Conn,
) -> AndThen<Self::LoadFuture<'conn>, TryCollect<Self::Stream<'conn>, Vec<U>>, fn(_: Self::Stream<'conn>) -> TryCollect<Self::Stream<'conn>, Vec<U>>>where
U: Send,
Conn: AsyncConnection,
Self: LoadQuery<'query, Conn, U> + 'query,
§fn load_stream<'conn, 'query, U>(
self,
conn: &'conn mut Conn,
) -> Self::LoadFuture<'conn>where
Conn: AsyncConnection,
U: 'conn,
Self: LoadQuery<'query, Conn, U> + 'query,
fn load_stream<'conn, 'query, U>(
self,
conn: &'conn mut Conn,
) -> Self::LoadFuture<'conn>where
Conn: AsyncConnection,
U: 'conn,
Self: LoadQuery<'query, Conn, U> + 'query,
Executes the given query, returning a [
Stream
] with the returned rows. Read more§fn get_result<'query, 'conn, U>(
self,
conn: &'conn mut Conn,
) -> AndThen<Self::LoadFuture<'conn>, Map<StreamFuture<Pin<Box<Self::Stream<'conn>>>>, fn(_: (Option<Result<U, Error>>, Pin<Box<Self::Stream<'conn>>>)) -> Result<U, Error>>, fn(_: Self::Stream<'conn>) -> Map<StreamFuture<Pin<Box<Self::Stream<'conn>>>>, fn(_: (Option<Result<U, Error>>, Pin<Box<Self::Stream<'conn>>>)) -> Result<U, Error>>>where
U: Send + 'conn,
Conn: AsyncConnection,
Self: LoadQuery<'query, Conn, U> + 'query,
fn get_result<'query, 'conn, U>(
self,
conn: &'conn mut Conn,
) -> AndThen<Self::LoadFuture<'conn>, Map<StreamFuture<Pin<Box<Self::Stream<'conn>>>>, fn(_: (Option<Result<U, Error>>, Pin<Box<Self::Stream<'conn>>>)) -> Result<U, Error>>, fn(_: Self::Stream<'conn>) -> Map<StreamFuture<Pin<Box<Self::Stream<'conn>>>>, fn(_: (Option<Result<U, Error>>, Pin<Box<Self::Stream<'conn>>>)) -> Result<U, Error>>>where
U: Send + 'conn,
Conn: AsyncConnection,
Self: LoadQuery<'query, Conn, U> + 'query,
Runs the command, and returns the affected row. Read more
§fn get_results<'query, 'conn, U>(
self,
conn: &'conn mut Conn,
) -> AndThen<Self::LoadFuture<'conn>, TryCollect<Self::Stream<'conn>, Vec<U>>, fn(_: Self::Stream<'conn>) -> TryCollect<Self::Stream<'conn>, Vec<U>>>where
U: Send,
Conn: AsyncConnection,
Self: LoadQuery<'query, Conn, U> + 'query,
fn get_results<'query, 'conn, U>(
self,
conn: &'conn mut Conn,
) -> AndThen<Self::LoadFuture<'conn>, TryCollect<Self::Stream<'conn>, Vec<U>>, fn(_: Self::Stream<'conn>) -> TryCollect<Self::Stream<'conn>, Vec<U>>>where
U: Send,
Conn: AsyncConnection,
Self: LoadQuery<'query, Conn, U> + 'query,
Runs the command, returning an
Vec
with the affected rows. Read more§fn first<'query, 'conn, U>(
self,
conn: &'conn mut Conn,
) -> AndThen<<Self::Output as LoadQuery<'query, Conn, U>>::LoadFuture<'conn>, Map<StreamFuture<Pin<Box<<Self::Output as LoadQuery<'query, Conn, U>>::Stream<'conn>>>>, fn(_: (Option<Result<U, Error>>, Pin<Box<<Self::Output as LoadQuery<'query, Conn, U>>::Stream<'conn>>>)) -> Result<U, Error>>, fn(_: <Self::Output as LoadQuery<'query, Conn, U>>::Stream<'conn>) -> Map<StreamFuture<Pin<Box<<Self::Output as LoadQuery<'query, Conn, U>>::Stream<'conn>>>>, fn(_: (Option<Result<U, Error>>, Pin<Box<<Self::Output as LoadQuery<'query, Conn, U>>::Stream<'conn>>>)) -> Result<U, Error>>>
fn first<'query, 'conn, U>( self, conn: &'conn mut Conn, ) -> AndThen<<Self::Output as LoadQuery<'query, Conn, U>>::LoadFuture<'conn>, Map<StreamFuture<Pin<Box<<Self::Output as LoadQuery<'query, Conn, U>>::Stream<'conn>>>>, fn(_: (Option<Result<U, Error>>, Pin<Box<<Self::Output as LoadQuery<'query, Conn, U>>::Stream<'conn>>>)) -> Result<U, Error>>, fn(_: <Self::Output as LoadQuery<'query, Conn, U>>::Stream<'conn>) -> Map<StreamFuture<Pin<Box<<Self::Output as LoadQuery<'query, Conn, U>>::Stream<'conn>>>>, fn(_: (Option<Result<U, Error>>, Pin<Box<<Self::Output as LoadQuery<'query, Conn, U>>::Stream<'conn>>>)) -> Result<U, Error>>>
Attempts to load a single record. Read more
§impl<T, DB> SelectableHelper<DB> for Twhere
T: Selectable<DB>,
DB: Backend,
impl<T, DB> SelectableHelper<DB> for Twhere
T: Selectable<DB>,
DB: Backend,
§fn as_select() -> SelectBy<T, DB>
fn as_select() -> SelectBy<T, DB>
Construct a select clause based on a [
Selectable
] implementation. Read more§fn as_returning() -> SelectBy<Self, DB>
fn as_returning() -> SelectBy<Self, DB>
An alias for
as_select
that can be used with returning clauses§impl<T, ST, DB> StaticallySizedRow<ST, DB> for Twhere
ST: SqlTypeOrSelectable + TupleSize,
T: Queryable<ST, DB>,
DB: Backend,
impl<T, ST, DB> StaticallySizedRow<ST, DB> for Twhere
ST: SqlTypeOrSelectable + TupleSize,
T: Queryable<ST, DB>,
DB: Backend,
§const FIELD_COUNT: usize = <ST as crate::util::TupleSize>::SIZE
const FIELD_COUNT: usize = <ST as crate::util::TupleSize>::SIZE
The number of fields that this type will consume.