[−][src]Struct azure_functions::bindings::GenericTrigger
Represents a generic trigger binding.
The following binding attributes are supported:
Name | Description |
---|---|
type | The binding type. |
name | The name of the parameter being bound. |
* | The additional binding attributes specific to the binding type. Supported value types are strings, booleans, and integers. |
Examples
An example of using a GenericTrigger
binding instead of a CosmosDbTrigger
binding:
use azure_functions::{bindings::GenericTrigger, func, generic::Value}; use log::info; #[func] #[binding( type = "cosmosDBTrigger", name = "trigger", connectionStringSetting = "connection", databaseName = "exampledb", collectionName = "documents", createLeaseCollectionIfNotExists = true )] pub fn log_documents(trigger: GenericTrigger) { match trigger.data { Value::Json(v) => { info!("{}", v); } _ => panic!("expected JSON for Cosmos DB trigger data"), } }
Fields
data: Value
The trigger binding data.
metadata: HashMap<String, Value>
The trigger metadata.
Trait Implementations
impl Clone for GenericTrigger
[src]
fn clone(&self) -> GenericTrigger
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for GenericTrigger
[src]
Auto Trait Implementations
impl Send for GenericTrigger
impl Sync for GenericTrigger
impl Unpin for GenericTrigger
impl UnwindSafe for GenericTrigger
impl RefUnwindSafe for GenericTrigger
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> IntoRequest<T> for T
[src]
fn into_request(self) -> Request<T>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,