Struct jplaceholder::user::User[][src]

pub struct User {
    pub id: i32,
    pub name: String,
    pub username: String,
    pub email: String,
    pub address: Address,
    pub phone: String,
    pub website: String,
    pub company: Company,
}

Fields

Methods

impl User
[src]

Gets all the articles posted by this user

Example

use jplaceholder::Model;
use jplaceholder::User;
use jplaceholder::Post;
 
let user = match User::find(1) {
    Some(u) => u,
    None => panic!("user not found")
};
let posts: Vec<Post> = user.posts().expect("This user has posted no article");
println!("{} posted {} articles", user.name, posts.len());

Trait Implementations

impl Debug for User
[src]

Formats the value using the given formatter. Read more

impl PartialEq for User
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Model<User> for User
[src]

Finds a resource by its ID Read more

Gets all of the resources Read more

Creates a new resource Read more

Auto Trait Implementations

impl Send for User

impl Sync for User