pub struct MemberBuilder {
pub uuid: Uuid,
pub nickname: Option<String>,
pub user_uuid: Uuid,
pub guild_uuid: Uuid,
pub is_owner: bool,
}
Fields§
§uuid: Uuid
§nickname: Option<String>
§user_uuid: Uuid
§guild_uuid: Uuid
§is_owner: bool
Implementations§
Source§impl MemberBuilder
impl MemberBuilder
pub async fn build( &self, conn: &mut Object<AsyncDieselConnectionManager<AsyncPgConnection>>, cache_pool: &Client, me: Option<&Me>, ) -> Result<Member, Error>
async fn build_with_parts( &self, conn: &mut Object<AsyncDieselConnectionManager<AsyncPgConnection>>, cache_pool: &Client, user_builder: UserBuilder, friend: Option<Friend>, ) -> Result<Member, Error>
pub async fn check_permission( &self, conn: &mut Object<AsyncDieselConnectionManager<AsyncPgConnection>>, cache_pool: &Client, permission: Permissions, ) -> Result<(), Error>
Trait Implementations§
Source§impl<__FK> BelongsTo<&Guild> for MemberBuilderwhere
__FK: Hash + Eq,
for<'__a> &'__a Uuid: Into<Option<&'__a __FK>>,
for<'__a> &'__a Guild: Identifiable<Id = &'__a __FK>,
impl<__FK> BelongsTo<&Guild> for MemberBuilderwhere
__FK: Hash + Eq,
for<'__a> &'__a Uuid: Into<Option<&'__a __FK>>,
for<'__a> &'__a Guild: Identifiable<Id = &'__a __FK>,
Source§type ForeignKey = __FK
type ForeignKey = __FK
The foreign key of this struct
Source§type ForeignKeyColumn = guild_uuid
type ForeignKeyColumn = guild_uuid
The database column representing the foreign key
of the table this struct represents
Source§fn foreign_key(&self) -> Option<&Self::ForeignKey>
fn foreign_key(&self) -> Option<&Self::ForeignKey>
Returns the foreign key for
self
Source§fn foreign_key_column() -> Self::ForeignKeyColumn
fn foreign_key_column() -> Self::ForeignKeyColumn
Returns the foreign key column of this struct’s table
Source§impl<__FK> BelongsTo<&MemberBuilder> for RoleMemberwhere
__FK: Hash + Eq,
for<'__a> &'__a Uuid: Into<Option<&'__a __FK>>,
for<'__a> &'__a MemberBuilder: Identifiable<Id = &'__a __FK>,
impl<__FK> BelongsTo<&MemberBuilder> for RoleMemberwhere
__FK: Hash + Eq,
for<'__a> &'__a Uuid: Into<Option<&'__a __FK>>,
for<'__a> &'__a MemberBuilder: Identifiable<Id = &'__a __FK>,
Source§type ForeignKey = __FK
type ForeignKey = __FK
The foreign key of this struct
Source§type ForeignKeyColumn = member_uuid
type ForeignKeyColumn = member_uuid
The database column representing the foreign key
of the table this struct represents
Source§fn foreign_key(&self) -> Option<&Self::ForeignKey>
fn foreign_key(&self) -> Option<&Self::ForeignKey>
Returns the foreign key for
self
Source§fn foreign_key_column() -> Self::ForeignKeyColumn
fn foreign_key_column() -> Self::ForeignKeyColumn
Returns the foreign key column of this struct’s table
Source§impl<__FK> BelongsTo<&UserBuilder> for MemberBuilderwhere
__FK: Hash + Eq,
for<'__a> &'__a Uuid: Into<Option<&'__a __FK>>,
for<'__a> &'__a UserBuilder: Identifiable<Id = &'__a __FK>,
impl<__FK> BelongsTo<&UserBuilder> for MemberBuilderwhere
__FK: Hash + Eq,
for<'__a> &'__a Uuid: Into<Option<&'__a __FK>>,
for<'__a> &'__a UserBuilder: Identifiable<Id = &'__a __FK>,
Source§type ForeignKey = __FK
type ForeignKey = __FK
The foreign key of this struct
Source§type ForeignKeyColumn = user_uuid
type ForeignKeyColumn = user_uuid
The database column representing the foreign key
of the table this struct represents
Source§fn foreign_key(&self) -> Option<&Self::ForeignKey>
fn foreign_key(&self) -> Option<&Self::ForeignKey>
Returns the foreign key for
self
Source§fn foreign_key_column() -> Self::ForeignKeyColumn
fn foreign_key_column() -> Self::ForeignKeyColumn
Returns the foreign key column of this struct’s table
Source§impl<__FK> BelongsTo<Guild> for MemberBuilderwhere
__FK: Hash + Eq,
for<'__a> &'__a Uuid: Into<Option<&'__a __FK>>,
for<'__a> &'__a Guild: Identifiable<Id = &'__a __FK>,
impl<__FK> BelongsTo<Guild> for MemberBuilderwhere
__FK: Hash + Eq,
for<'__a> &'__a Uuid: Into<Option<&'__a __FK>>,
for<'__a> &'__a Guild: Identifiable<Id = &'__a __FK>,
Source§type ForeignKey = __FK
type ForeignKey = __FK
The foreign key of this struct
Source§type ForeignKeyColumn = guild_uuid
type ForeignKeyColumn = guild_uuid
The database column representing the foreign key
of the table this struct represents
Source§fn foreign_key(&self) -> Option<&Self::ForeignKey>
fn foreign_key(&self) -> Option<&Self::ForeignKey>
Returns the foreign key for
self
Source§fn foreign_key_column() -> Self::ForeignKeyColumn
fn foreign_key_column() -> Self::ForeignKeyColumn
Returns the foreign key column of this struct’s table
Source§impl<__FK> BelongsTo<MemberBuilder> for RoleMemberwhere
__FK: Hash + Eq,
for<'__a> &'__a Uuid: Into<Option<&'__a __FK>>,
for<'__a> &'__a MemberBuilder: Identifiable<Id = &'__a __FK>,
impl<__FK> BelongsTo<MemberBuilder> for RoleMemberwhere
__FK: Hash + Eq,
for<'__a> &'__a Uuid: Into<Option<&'__a __FK>>,
for<'__a> &'__a MemberBuilder: Identifiable<Id = &'__a __FK>,
Source§type ForeignKey = __FK
type ForeignKey = __FK
The foreign key of this struct
Source§type ForeignKeyColumn = member_uuid
type ForeignKeyColumn = member_uuid
The database column representing the foreign key
of the table this struct represents
Source§fn foreign_key(&self) -> Option<&Self::ForeignKey>
fn foreign_key(&self) -> Option<&Self::ForeignKey>
Returns the foreign key for
self
Source§fn foreign_key_column() -> Self::ForeignKeyColumn
fn foreign_key_column() -> Self::ForeignKeyColumn
Returns the foreign key column of this struct’s table
Source§impl<__FK> BelongsTo<UserBuilder> for MemberBuilderwhere
__FK: Hash + Eq,
for<'__a> &'__a Uuid: Into<Option<&'__a __FK>>,
for<'__a> &'__a UserBuilder: Identifiable<Id = &'__a __FK>,
impl<__FK> BelongsTo<UserBuilder> for MemberBuilderwhere
__FK: Hash + Eq,
for<'__a> &'__a Uuid: Into<Option<&'__a __FK>>,
for<'__a> &'__a UserBuilder: Identifiable<Id = &'__a __FK>,
Source§type ForeignKey = __FK
type ForeignKey = __FK
The foreign key of this struct
Source§type ForeignKeyColumn = user_uuid
type ForeignKeyColumn = user_uuid
The database column representing the foreign key
of the table this struct represents
Source§fn foreign_key(&self) -> Option<&Self::ForeignKey>
fn foreign_key(&self) -> Option<&Self::ForeignKey>
Returns the foreign key for
self
Source§fn foreign_key_column() -> Self::ForeignKeyColumn
fn foreign_key_column() -> Self::ForeignKeyColumn
Returns the foreign key column of this struct’s table
Source§impl HasTable for MemberBuilder
impl HasTable for MemberBuilder
Source§impl<'ident> Identifiable for &'ident MemberBuilder
impl<'ident> Identifiable for &'ident MemberBuilder
Source§impl<'insert> Insertable<table> for &'insert MemberBuilder
impl<'insert> Insertable<table> for &'insert MemberBuilder
Source§type Values = <(Option<Grouped<Eq<uuid, <&'insert Uuid as AsExpression<<uuid as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<nickname, <&'insert String as AsExpression<<nickname as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<user_uuid, <&'insert Uuid as AsExpression<<user_uuid as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<guild_uuid, <&'insert Uuid as AsExpression<<guild_uuid as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<is_owner, <&'insert bool as AsExpression<<is_owner 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<nickname, <&'insert String as AsExpression<<nickname as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<user_uuid, <&'insert Uuid as AsExpression<<user_uuid as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<guild_uuid, <&'insert Uuid as AsExpression<<guild_uuid as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<is_owner, <&'insert bool as AsExpression<<is_owner 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<nickname, &'insert String>>, Option<Eq<user_uuid, &'insert Uuid>>, Option<Eq<guild_uuid, &'insert Uuid>>, Option<Eq<is_owner, &'insert bool>>) as Insertable<table>>::Values
fn values( self, ) -> <(Option<Eq<uuid, &'insert Uuid>>, Option<Eq<nickname, &'insert String>>, Option<Eq<user_uuid, &'insert Uuid>>, Option<Eq<guild_uuid, &'insert Uuid>>, Option<Eq<is_owner, &'insert bool>>) 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 MemberBuilder
impl Insertable<table> for MemberBuilder
Source§type Values = <(Option<Grouped<Eq<uuid, <Uuid as AsExpression<<uuid as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<nickname, <String as AsExpression<<nickname as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<user_uuid, <Uuid as AsExpression<<user_uuid as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<guild_uuid, <Uuid as AsExpression<<guild_uuid as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<is_owner, <bool as AsExpression<<is_owner 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<nickname, <String as AsExpression<<nickname as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<user_uuid, <Uuid as AsExpression<<user_uuid as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<guild_uuid, <Uuid as AsExpression<<guild_uuid as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<is_owner, <bool as AsExpression<<is_owner 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<nickname, String>>, Option<Eq<user_uuid, Uuid>>, Option<Eq<guild_uuid, Uuid>>, Option<Eq<is_owner, bool>>) as Insertable<table>>::Values
fn values( self, ) -> <(Option<Eq<uuid, Uuid>>, Option<Eq<nickname, String>>, Option<Eq<user_uuid, Uuid>>, Option<Eq<guild_uuid, Uuid>>, Option<Eq<is_owner, bool>>) 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> Queryable<(__ST0, __ST1, __ST2, __ST3, __ST4), __DB> for MemberBuilder
impl<__DB: Backend, __ST0, __ST1, __ST2, __ST3, __ST4> Queryable<(__ST0, __ST1, __ST2, __ST3, __ST4), __DB> for MemberBuilder
Source§impl<__DB: Backend> Selectable<__DB> for MemberBuilder
impl<__DB: Backend> Selectable<__DB> for MemberBuilder
Source§type SelectExpression = (uuid, nickname, user_uuid, guild_uuid, is_owner)
type SelectExpression = (uuid, nickname, user_uuid, guild_uuid, is_owner)
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
Source§impl Serialize for MemberBuilder
impl Serialize for MemberBuilder
impl UndecoratedInsertRecord<table> for MemberBuilder
Auto Trait Implementations§
impl Freeze for MemberBuilder
impl RefUnwindSafe for MemberBuilder
impl Send for MemberBuilder
impl Sync for MemberBuilder
impl Unpin for MemberBuilder
impl UnwindSafe for MemberBuilder
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
§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.