pub struct ProfileObject {
pub profile: Profile,
}Expand description
§Example
use twitter_archive::structs::profile::ProfileObject;
let json = r#"{
"profile": {
"description": {
"bio": "Howdy!",
"website": "https://t.co/6VtgySlriu",
"location": ""
},
"avatarMediaUrl": "https://pbs.twimg.com/profile_images/575070434267279361/HSLiX96Z.jpeg"
}
}"#;
let data: ProfileObject = serde_json::from_str(&json).unwrap();
// De-serialized properties
assert_eq!(data.profile.description.bio, "Howdy!");
assert_eq!(data.profile.description.website, "https://t.co/6VtgySlriu");
assert_eq!(data.profile.description.location, "");
assert_eq!(data.profile.avatar_media_url, "https://pbs.twimg.com/profile_images/575070434267279361/HSLiX96Z.jpeg");
// Re-serialize is equivalent to original data
assert_eq!(serde_json::to_string_pretty(&data).unwrap(), json);Fields§
§profile: ProfileWhy they wrapped a list of name changes within unnecessary object label is anyone’s guess
§Example JSON data
{
"profile": {
"description": {
"bio": "Howdy!",
"website": "https://t.co/6VtgySlriu",
"location": ""
},
"avatarMediaUrl": "https://pbs.twimg.com/profile_images/575070434267279361/HSLiX96Z.jpeg"
}
}Trait Implementations§
Source§impl Clone for ProfileObject
impl Clone for ProfileObject
Source§fn clone(&self) -> ProfileObject
fn clone(&self) -> ProfileObject
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProfileObject
impl Debug for ProfileObject
Source§impl<'de> Deserialize<'de> for ProfileObject
impl<'de> Deserialize<'de> for ProfileObject
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 Display for ProfileObject
impl Display for ProfileObject
Auto Trait Implementations§
impl Freeze for ProfileObject
impl RefUnwindSafe for ProfileObject
impl Send for ProfileObject
impl Sync for ProfileObject
impl Unpin for ProfileObject
impl UnwindSafe for ProfileObject
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