Struct jplaceholder::post::Post[][src]

pub struct Post {
    pub user_id: i32,
    pub id: i32,
    pub title: String,
    pub body: String,
}

Fields

Methods

impl Post
[src]

Gets the author of the article

Example

use jplaceholder::Model;
use jplaceholder::Post;

if let Some(post) = Post::find(1) {
    match post.user() {
        Some(user) => println!("{} has posted this article", user.name),
        None => println!("Author not found")
    }
}

Trait Implementations

impl Debug for Post
[src]

Formats the value using the given formatter. Read more

impl PartialEq for Post
[src]

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

This method tests for !=.

impl Model<Post> for Post
[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 Post

impl Sync for Post