pub struct User {
pub id: Uuid,
pub name: String,
pub email: String,
pub password_hash: String,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}Expand description
§テーブル情報
| 項目 | 内容 |
|---|---|
| 論理名 | ユーザーテーブル |
| 物理名 | users |
| 説明 | サービスを利用するユーザー情報を格納する。 |
Fields§
§id: Uuid§カラム情報
| 項目 | 内容 |
|---|---|
| 論理名 | ユーザーID |
| 物理名 | id |
| データ型 | UUID |
| 説明 | ユーザーを一位に識別するID。 |
| 制約 | PRIMARY KEY, DEFAULT uuid_generate_v7() |
name: String§カラム情報
| 項目 | 内容 |
|---|---|
| 論理名 | ユーザー名 |
| 物理名 | name |
| データ型 | VARCHAR |
| 説明 | ユーザーが表示する名前。 |
| 制約 | NOT NULL, UNIQUE |
email: String§カラム情報
| 項目 | 内容 |
|---|---|
| 論理名 | メールアドレス |
| 物理名 | email |
| データ型 | VARCHAR |
| 説明 | ログインや通知に使用する。 |
| 制約 | NOT NULL, UNIQUE |
password_hash: String§カラム情報
| 項目 | 内容 |
|---|---|
| 論理名 | パスワードハッシュ |
| 物理名 | password_hash |
| データ型 | VARCHAR |
| 説明 | ハッシュ化されたパスワード。 |
| 制約 | NOT NULL |
created_at: DateTime<Utc>§カラム情報
| 項目 | 内容 |
|---|---|
| 論理名 | 作成日時 |
| 物理名 | created_at |
| データ型 | TIMESTAMP WITH TIME ZONE |
| 説明 | レコードが作成された日時。 |
| 制約 | NOT NULL, DEFAULT NOW() |
updated_at: DateTime<Utc>§カラム情報
| 項目 | 内容 |
|---|---|
| 論理名 | 更新日時 |
| 物理名 | updated_at |
| データ型 | TIMESTAMP WITH TIME ZONE |
| 説明 | レコードが最後に更新された日時。 |
| 制約 | NOT NULL, DEFAULT NOW() |
Trait Implementations§
Source§impl<'de> Deserialize<'de> for User
impl<'de> Deserialize<'de> for User
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<__DB: Backend, __ST0, __ST1, __ST2, __ST3, __ST4, __ST5> Queryable<(__ST0, __ST1, __ST2, __ST3, __ST4, __ST5), __DB> for User
impl<__DB: Backend, __ST0, __ST1, __ST2, __ST3, __ST4, __ST5> Queryable<(__ST0, __ST1, __ST2, __ST3, __ST4, __ST5), __DB> for User
Source§impl<__DB: Backend> Selectable<__DB> for User
impl<__DB: Backend> Selectable<__DB> for User
Source§type SelectExpression = (id, name, email, password_hash, created_at, updated_at)
type SelectExpression = (id, name, email, password_hash, created_at, updated_at)
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 Eq for User
impl StructuralPartialEq for User
Auto Trait Implementations§
impl Freeze for User
impl RefUnwindSafe for User
impl Send for User
impl Sync for User
impl Unpin for User
impl UnwindSafe for User
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§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>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoSql for T
impl<T> IntoSql for T
§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.