[−][src]Struct azure_functions::bindings::GenericOutput
Represents a generic output 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 GenericOutput
binding instead of a CosmosDbDocument
binding:
use azure_functions::{ bindings::{GenericOutput, HttpRequest, HttpResponse}, func, }; use serde_json::json; #[func] #[binding(name = "req", route = "create/{id}")] #[binding( type = "cosmosDB", name = "output1", connectionStringSetting = "connection", databaseName = "exampledb", collectionName = "documents", createIfNotExists = true )] pub fn create_document(req: HttpRequest) -> (HttpResponse, GenericOutput) { ( "Document was created.".into(), json!({ "id": req.route_params().get("id").unwrap(), "name": req.query_params().get("name").map_or("stranger", |x| x) }) .into(), ) }
Fields
data: Value
The output binding data.
Trait Implementations
impl<'_> From<&'_ str> for GenericOutput
[src]
impl From<String> for GenericOutput
[src]
impl From<Value> for GenericOutput
[src]
impl From<Vec<u8>> for GenericOutput
[src]
impl From<i64> for GenericOutput
[src]
impl From<f64> for GenericOutput
[src]
impl Clone for GenericOutput
[src]
fn clone(&self) -> GenericOutput
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for GenericOutput
[src]
Auto Trait Implementations
impl Send for GenericOutput
impl Sync for GenericOutput
impl Unpin for GenericOutput
impl UnwindSafe for GenericOutput
impl RefUnwindSafe for GenericOutput
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>,