You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead of repeating properties which form a common base, we should use structs to encapsulate these and serde(flatten) to flatten them into the containing structure.
An initial attempt at this (definitions below) with the following error:
Deserialize(Custom("invalid type: map, expected a string"))`
/// An attachment to an Exchange item.////// See <https://learn.microsoft.com/en-us/exchange/client-developer/web-service-reference/attachments-ex15websvcsotherref>#[derive(Debug,Deserialize)]pubenumAttachment{/// An attachment containing an Exchange item.////// See <https://learn.microsoft.com/en-us/exchange/client-developer/web-service-reference/itemattachment>#[serde(rename_all = "PascalCase")]ItemAttachment{#[serde(flatten)]info:AttachmentCommon,// XXX: With this field in place, parsing will fail if there is no// `AttachmentItem` in the response.// See https://github.com/tafia/quick-xml/issues/683// /// The attached item.// #[serde(rename = "$value")]// content: Option<AttachmentItem>,},/// An attachment containing a file.////// See <https://learn.microsoft.com/en-us/exchange/client-developer/web-service-reference/fileattachment>#[serde(rename_all = "PascalCase")]FileAttachment{#[serde(flatten)]info:AttachmentCommon,/// Whether the attachment represents a contact photo.////// See <https://learn.microsoft.com/en-us/exchange/client-developer/web-service-reference/iscontactphoto>is_contact_photo:Option<bool>,/// The base64-encoded content of the attachment.////// See <https://learn.microsoft.com/en-us/exchange/client-developer/web-service-reference/content>content:Option<String>,},}#[derive(Debug,Deserialize)]#[serde(rename_all = "PascalCase")]pubstructAttachmentCommon{/// An identifier for the attachment.pubattachment_id:AttachmentId,/// The name of the attachment.////// See <https://learn.microsoft.com/en-us/exchange/client-developer/web-service-reference/name-attachmenttype>pubname:String,/// The MIME type of the attachment's content.////// See <https://learn.microsoft.com/en-us/exchange/client-developer/web-service-reference/contenttype>pubcontent_type:String,/// An arbitrary identifier for the attachment.////// This field is not set by Exchange and is intended for use by/// external applications.////// See <https://learn.microsoft.com/en-us/exchange/client-developer/web-service-reference/contentid>pubcontent_id:Option<String>,/// A URI representing the location of the attachment's content.////// See <https://learn.microsoft.com/en-us/exchange/client-developer/web-service-reference/contentlocation>pubcontent_location:Option<String>,/// The size of the attachment's content in bytes.////// See <https://learn.microsoft.com/en-us/exchange/client-developer/web-service-reference/size>pubsize:Option<usize>,/// The most recent modification time for the attachment.////// See <https://learn.microsoft.com/en-us/exchange/client-developer/web-service-reference/lastmodifiedtime>publast_modified_time:Option<DateTime>,/// Whether the attachment appears inline in the item body.////// See <https://learn.microsoft.com/en-us/exchange/client-developer/web-service-reference/isinline>pubis_inline:Option<bool>,}
The text was updated successfully, but these errors were encountered:
Instead of repeating properties which form a common base, we should use structs to encapsulate these and
serde(flatten)
to flatten them into the containing structure.An initial attempt at this (definitions below) with the following error:
The text was updated successfully, but these errors were encountered: