[][src]Struct azure_functions::bindings::Table

pub struct Table(_);

Represents an Azure Storage table input or output binding.

Examples

Read a table storage row based on a key posted to the example queue:

use azure_functions::bindings::{QueueTrigger, Table};
use azure_functions::func;

#[func]
#[binding(name = "trigger", queue_name = "example")]
#[binding(name = "table", table_name = "MyTable", partition_key = "MyPartition", row_key = "{queueTrigger}")]
pub fn log_row(trigger: &QueueTrigger, table: &Table) {
    info!("Row: {:?}", table.rows().nth(0));
}

Run an Azure Storage table query based on a HTTP request:

use azure_functions::bindings::{HttpRequest, Table};
use azure_functions::func;

#[func]
#[binding(name = "table", table_name = "MyTable", filter = "{filter}")]
pub fn log_rows(req: &HttpRequest, table: &Table) {
    for row in table.rows() {
        info!("Row: {:?}", row);
    }
}

Methods

impl Table[src]

pub fn new() -> Table[src]

Creates a new table binding.

The new table binding can be used for output.

pub fn is_empty(&self) -> bool[src]

Gets whether or not the table binding is empty (no rows).

pub fn len(&self) -> usize[src]

Gets the current length of the rows stored in the table binding.

pub fn rows(
    &self
) -> impl Iterator<Item = &Row>
[src]

Gets the iterator over the rows stored in the table binding.

For input bindings, this will be the rows returned from either a single entity lookup or a filter query.

For output bindings, this will be the rows that have been added to the table binding.

pub fn add_row(&mut self, partition_key: &str, row_key: &str) -> &mut Row[src]

Adds a new row to the table binding with the specified partition and row keys.

pub fn add_row_value(&mut self, value: Value)[src]

Adds a row as a value to the table.

pub fn as_value(&self) -> &Value[src]

Gets the table as a JSON value.

pub fn into_value(self) -> Value[src]

Converts the table binding to a JSON value.

Trait Implementations

impl Default for Table[src]

impl Clone for Table[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl From<TypedData> for Table[src]

impl Into<TypedData> for Table[src]

impl Display for Table[src]

impl Debug for Table[src]

Auto Trait Implementations

impl Send for Table

impl Sync for Table

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Erased for T