pub struct TimerInfo {
pub schedule_status: ScheduleStatus,
pub is_past_due: bool,
}
Expand description
Represents the timer information from a timer trigger binding.
The following binding attributes are supported:
Name | Description |
---|---|
name | The name of the parameter being bound. |
schedule | The CRON expression or a TimeSpan value for the timer. A TimeSpan can be used only for a function app that runs on an App Service Plan. |
run_on_startup | If true , the function is invoked when the runtime starts. It should rarely, if ever, be set to true in production as the function will be invoked on runtime restarts and scale outs. |
use_monitor | Set to true or false to indicate whether the schedule should be monitored. Schedule monitoring persists schedule occurrences to aid in ensuring the schedule is maintained correctly even when function app instances restart. |
§Examples
A function that runs every 5 minutes:
use azure_functions::bindings::TimerInfo;
use azure_functions::func;
use log::info;
#[func]
#[binding(name = "_info", schedule = "0 */5 * * * *")]
pub fn timer(_info: TimerInfo) {
info!("Rust Azure function ran!");
}
Fields§
§schedule_status: ScheduleStatus
The schedule status for the timer.
If schedule monitoring is not enabled for the timer, this field will be None
.
is_past_due: bool
Determines if the timer invocation is due to a missed schedule occurrence.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TimerInfo
impl<'de> Deserialize<'de> for TimerInfo
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for TimerInfo
impl RefUnwindSafe for TimerInfo
impl Send for TimerInfo
impl Sync for TimerInfo
impl Unpin for TimerInfo
impl UnwindSafe for TimerInfo
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