pub struct QueueTrigger {
pub message: QueueMessage,
pub id: String,
pub dequeue_count: u32,
pub expiration_time: DateTime<Utc>,
pub insertion_time: DateTime<Utc>,
pub next_visible_time: DateTime<Utc>,
pub pop_receipt: String,
}
Expand description
Represents a queue trigger binding.
The following binding attributes are supported:
Name | Description |
---|---|
name | The name of the parameter being bound. |
queue_name | The name of the queue to poll. |
connection | The name of an app setting that contains the Azure Storage connection string to use for this binding. Defaults to the AzureWebJobsStorage . |
§Examples
A function that runs when a message is posted to a queue called example
:
use azure_functions::bindings::QueueTrigger;
use azure_functions::func;
use log::info;
#[func]
#[binding(name = "trigger", queue_name = "example")]
pub fn run_on_message(trigger: QueueTrigger) {
info!("Rust function ran due to queue message: {}", trigger.message);
}
Fields§
§message: QueueMessage
The queue message that triggered the function.
id: String
The queue message identifier.
dequeue_count: u32
The number of times this message has been dequeued.
expiration_time: DateTime<Utc>
The time that the message expires.
insertion_time: DateTime<Utc>
The time that the message was added to the queue.
next_visible_time: DateTime<Utc>
The time that the message will next be visible.
pop_receipt: String
The message’s pop receipt.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for QueueTrigger
impl RefUnwindSafe for QueueTrigger
impl Send for QueueTrigger
impl Sync for QueueTrigger
impl Unpin for QueueTrigger
impl UnwindSafe for QueueTrigger
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> 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