pub struct QueueMessage(/* private fields */);
Expand description
Represents an Azure Storage Queue message output binding.
The following binding attributes are supported:
Name | Description |
---|---|
name | The name of the parameter being bound. |
queue_name | The name of the queue. |
connection | The name of an app setting that contains the Azure Storage connection string to use for this binding. Defaults to the AzureWebJobsStorage . |
§Examples
Creating a queue message from a string:
use azure_functions::bindings::{HttpRequest, QueueMessage};
use azure_functions::func;
#[func]
#[binding(name = "output1", queue_name = "example")]
pub fn example(_req: HttpRequest) -> ((), QueueMessage) {
((), "Hello world!".into())
}
Creating a queue message from a JSON value (see the json! macro from the serde_json
crate):
use azure_functions::bindings::{HttpRequest, QueueMessage};
use azure_functions::func;
use serde_json::json;
#[func]
#[binding(name = "output1", queue_name = "example")]
pub fn example(_req: HttpRequest) -> ((), QueueMessage) {
((), json!({ "hello": "world" }).into())
}
Creating a queue message from a sequence of bytes:
use azure_functions::bindings::{HttpRequest, QueueMessage};
use azure_functions::func;
use serde_json::json;
#[func]
#[binding(name = "output1", queue_name = "example")]
pub fn example(_req: HttpRequest) -> ((), QueueMessage) {
((), [1, 2, 3][..].into())
}
Implementations§
Source§impl QueueMessage
impl QueueMessage
Trait Implementations§
Source§impl Clone for QueueMessage
impl Clone for QueueMessage
Source§fn clone(&self) -> QueueMessage
fn clone(&self) -> QueueMessage
Returns a copy 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 QueueMessage
impl Debug for QueueMessage
Source§impl Display for QueueMessage
impl Display for QueueMessage
Source§impl<'a> From<&'a [u8]> for QueueMessage
impl<'a> From<&'a [u8]> for QueueMessage
Source§impl From<&Value> for QueueMessage
impl From<&Value> for QueueMessage
Source§impl<'a> From<&'a str> for QueueMessage
impl<'a> From<&'a str> for QueueMessage
Source§impl From<String> for QueueMessage
impl From<String> for QueueMessage
Source§impl From<Value> for QueueMessage
impl From<Value> for QueueMessage
Source§impl<'a> Into<Body<'a>> for QueueMessage
impl<'a> Into<Body<'a>> for QueueMessage
Source§impl Into<String> for QueueMessage
impl Into<String> for QueueMessage
Source§impl Into<Value> for QueueMessage
impl Into<Value> for QueueMessage
Auto Trait Implementations§
impl Freeze for QueueMessage
impl RefUnwindSafe for QueueMessage
impl Send for QueueMessage
impl Sync for QueueMessage
impl Unpin for QueueMessage
impl UnwindSafe for QueueMessage
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request