pub struct BlockingObject {
pub blocking: Blocking,
}Expand description
§Example
use chrono::{DateTime, NaiveDateTime, Utc};
use twitter_archive::convert::date_time_iso_8601::FORMAT;
use twitter_archive::structs::block::BlockingObject;
let created_at_string = "2020-01-20T21:42:09.068Z";
let created_at_native_time = NaiveDateTime::parse_from_str(&created_at_string, FORMAT).unwrap();
let created_at_date_time = DateTime::<Utc>::from_naive_utc_and_offset(created_at_native_time, Utc);
let json = r#"{
"blocking" : {
"accountId" : "3333333333333333333",
"userLink" : "https://twitter.com/intent/user?user_id=3333333333333333333"
}
}"#;
let data: BlockingObject = serde_json::from_str(&json).unwrap();
// De-serialized properties
assert_eq!(data.blocking.account_id, "3333333333333333333");
assert_eq!(data.blocking.user_link, "https://twitter.com/intent/user?user_id=3333333333333333333");
// Re-serialize is equivalent to original data without pretty printing
// assert_eq!(serde_json::to_string(&data).unwrap(), json.replace("\n", "").replace(" ", ""));Fields§
§blocking: Blocking§Example JSON data
{
"blocking" : {
"accountId" : "3333333333333333333",
"userLink" : "https://twitter.com/intent/user?user_id=3333333333333333333"
}
}Trait Implementations§
Source§impl Clone for BlockingObject
impl Clone for BlockingObject
Source§fn clone(&self) -> BlockingObject
fn clone(&self) -> BlockingObject
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 BlockingObject
impl Debug for BlockingObject
Source§impl<'de> Deserialize<'de> for BlockingObject
impl<'de> Deserialize<'de> for BlockingObject
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 BlockingObject
impl Display for BlockingObject
Auto Trait Implementations§
impl Freeze for BlockingObject
impl RefUnwindSafe for BlockingObject
impl Send for BlockingObject
impl Sync for BlockingObject
impl Unpin for BlockingObject
impl UnwindSafe for BlockingObject
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