azure_storage_queue 0.5.0

Microsoft Azure Queue client library for Rust
Documentation
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
//
// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT.

use super::{
    ListQueuesResponse, QueueItem, QueueMessage, QueueServiceProperties, SignedIdentifiers,
};
use async_trait::async_trait;
use azure_core::{
    http::{pager::Page, RequestContent, XmlFormat},
    xml::to_xml,
    Result,
};

#[async_trait]
impl Page for ListQueuesResponse {
    type Item = QueueItem;
    type IntoIter = <Vec<QueueItem> as IntoIterator>::IntoIter;
    async fn into_items(self) -> Result<Self::IntoIter> {
        Ok(self.queue_items.into_iter())
    }
}

impl TryFrom<QueueMessage> for RequestContent<QueueMessage, XmlFormat> {
    type Error = azure_core::Error;
    fn try_from(value: QueueMessage) -> Result<Self> {
        Ok(to_xml(&value)?.into())
    }
}

impl TryFrom<QueueServiceProperties> for RequestContent<QueueServiceProperties, XmlFormat> {
    type Error = azure_core::Error;
    fn try_from(value: QueueServiceProperties) -> Result<Self> {
        Ok(to_xml(&value)?.into())
    }
}

impl TryFrom<SignedIdentifiers> for RequestContent<SignedIdentifiers, XmlFormat> {
    type Error = azure_core::Error;
    fn try_from(value: SignedIdentifiers) -> Result<Self> {
        Ok(to_xml(&value)?.into())
    }
}