pub struct Blocking {
pub account_id: String,
pub user_link: String,
}Expand description
§Example
use chrono::{DateTime, NaiveDateTime, Utc};
use twitter_archive::convert::date_time_iso_8601::FORMAT;
use twitter_archive::structs::block::Blocking;
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#"{
"accountId" : "3333333333333333333",
"userLink" : "https://twitter.com/intent/user?user_id=3333333333333333333"
}"#;
let data: Blocking = serde_json::from_str(&json).unwrap();
// De-serialized properties
assert_eq!(data.account_id, "3333333333333333333");
assert_eq!(data.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§
§account_id: StringURL formats;
- Desktop:
https://twitter.com/i/user/{account_id}
Note; does not work if not logged-in. Thanks be to Mr. Musk !-D
§Example JSON data
{ "accountId" : "3333333333333333333" }user_link: StringAlternate way of directly linking to account by ID, with added side effect of prompting client to follow profile regardless of following status
§Example JSON data
{ "userLink" : "https://twitter.com/intent/user?user_id=3333333333333333333" }Trait Implementations§
Source§impl<'de> Deserialize<'de> for Blocking
impl<'de> Deserialize<'de> for Blocking
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
Auto Trait Implementations§
impl Freeze for Blocking
impl RefUnwindSafe for Blocking
impl Send for Blocking
impl Sync for Blocking
impl Unpin for Blocking
impl UnwindSafe for Blocking
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