[][src]Struct azure_functions::bindings::Blob

pub struct Blob(_);

Represents a Azure Storage blob input or output binding.

Examples

Creating a blob from a string:

use azure_functions::bindings::Blob;

let blob: Blob = "hello world!".into();
assert_eq!(blob.as_str().unwrap(), "hello world!");

Creating a blob from a JSON value (see the json! macro from the serde_json crate):

use azure_functions::bindings::Blob;

let blob: Blob = json!({ "hello": "world!" }).into();

assert_eq!(blob.as_str().unwrap(), r#"{"hello":"world!"}"#);

Creating a blob from a sequence of bytes:

use azure_functions::bindings::Blob;

let blob: Blob = [1, 2, 3][..].into();

assert_eq!(
    blob.as_bytes(),
    [1, 2, 3]
);

Methods

impl Blob
[src]

Gets the content of the blob as a string.

Returns None if there is no valid string representation of the blob.

Gets the content of the blob as a slice of bytes.

Deserializes the blob as JSON to the requested type.

Trait Implementations

impl Clone for Blob
[src]

Performs copy-assignment from source. Read more

impl<'a> From<&'a str> for Blob
[src]

impl From<String> for Blob
[src]

impl<'_> From<&'_ Value> for Blob
[src]

impl From<Value> for Blob
[src]

impl<'a> From<&'a [u8]> for Blob
[src]

impl From<Vec<u8>> for Blob
[src]

impl From<TypedData> for Blob
[src]

impl Into<TypedData> for Blob
[src]

impl Display for Blob
[src]

impl Debug for Blob
[src]

Auto Trait Implementations

impl Send for Blob

impl Sync for Blob

Blanket Implementations

impl<T> From for T
[src]

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

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

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

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

🔬 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, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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