Struct jplaceholder::post::Post [−][src]
Fields
user_id: i32
id: i32
title: String
body: String
Methods
impl Post
[src]
impl Post
pub fn user(self) -> Option<User>
[src]
pub fn user(self) -> Option<User>
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]
impl Debug for Post
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl PartialEq for Post
[src]
impl PartialEq for Post
fn eq(&self, other: &Post) -> bool
[src]
fn eq(&self, other: &Post) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]This method tests for !=
.
impl Model<Post> for Post
[src]
impl Model<Post> for Post