Struct cargo_registry::user::User
[−]
[src]
pub struct User { pub id: i32, pub email: Option<String>, pub gh_access_token: String, pub api_token: String, pub gh_login: String, pub name: Option<String>, pub gh_avatar: Option<String>, pub gh_id: i32, }
The model representing a row in the users
database table.
Fields
id: i32
email: Option<String>
gh_access_token: String
api_token: String
gh_login: String
name: Option<String>
gh_avatar: Option<String>
gh_id: i32
Methods
impl User
[src]
fn find_by_login(conn: &GenericConnection, login: &str) -> CargoResult<User>
Queries the database for a user with a certain gh_login
value.
fn find_by_api_token(conn: &GenericConnection, token: &str) -> CargoResult<User>
Queries the database for a user with a certain api_token
value.
fn find_or_insert(
conn: &GenericConnection,
id: i32,
login: &str,
email: Option<&str>,
name: Option<&str>,
avatar: Option<&str>,
access_token: &str
) -> CargoResult<User>
conn: &GenericConnection,
id: i32,
login: &str,
email: Option<&str>,
name: Option<&str>,
avatar: Option<&str>,
access_token: &str
) -> CargoResult<User>
Updates a user or inserts a new user into the database.
fn encodable(self) -> EncodableUser
Converts this User
model into an EncodableUser
for JSON serialization.
Trait Implementations
impl Clone for User
[src]
fn clone(&self) -> User
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Debug for User
[src]
impl PartialEq for User
[src]
fn eq(&self, __arg_0: &User) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &User) -> bool
This method tests for !=
.