updated reqwest and fixed media route
reqwest updated to 0.8 removed Result for creating Mastodon client as result of reqwest update added Meta and ImageDetails struct for Attachment Changed Attachment.id to String Added test for media route. Changed paramaters for media from Vec<u8> of image data to String of file path. Added dotenv for testing
This commit is contained in:
@@ -1,12 +1,29 @@
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
pub struct Attachment {
|
||||
pub id: u64,
|
||||
pub id: String,
|
||||
#[serde(rename="type")]
|
||||
pub media_type: MediaType,
|
||||
pub url: String,
|
||||
pub remote_url: String,
|
||||
pub remote_url: Option<String>,
|
||||
pub preview_url: String,
|
||||
pub text_url: Option<String>,
|
||||
pub meta: Option<Meta>,
|
||||
pub description: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Clone)]
|
||||
pub struct Meta {
|
||||
original: ImageDetails,
|
||||
small: ImageDetails,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Clone)]
|
||||
pub struct ImageDetails {
|
||||
width: u64,
|
||||
height: u64,
|
||||
size: String,
|
||||
aspect: f64,
|
||||
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Clone, Copy)]
|
||||
|
||||
Reference in New Issue
Block a user