[][src]Struct azure_functions::bindings::SignalRGroupAction

pub struct SignalRGroupAction {
    pub group_name: String,
    pub user_id: String,
    pub action: GroupAction,
}

Represents the SignalR group action output binding.

The following binding attributes are supported:

NameDescription
nameThe name of the parameter being bound.
hub_nameThe name of the SignalR hub that will receive the group action.
connectionThe name of the app setting that contains the SignalR Service connection string. Defaults to AzureSignalRConnectionString.

Examples

This example implements an HTTP-triggered Azure Function that adds a user to a group:

use azure_functions::{
    bindings::{HttpRequest, SignalRGroupAction},
    func,
    signalr::GroupAction,
};

#[func]
#[binding(name = "req", auth_level = "anonymous", methods = "post")]
#[binding(name = "$return", hub_name = "chat", connection = "myconnection")]
pub fn add_to_group(req: HttpRequest) -> SignalRGroupAction {
    SignalRGroupAction {
        user_id: req.query_params().get("user").unwrap().to_owned(),
        group_name: req.query_params().get("group").unwrap().to_owned(),
        action: GroupAction::Add,
    }
}

Fields

group_name: String

The name of the group to operate on.

user_id: String

The user id to operate on.

action: GroupAction

The action to take.

Trait Implementations

impl Clone for SignalRGroupAction[src]

impl Debug for SignalRGroupAction[src]

impl Serialize for SignalRGroupAction[src]

impl<'de> Deserialize<'de> for SignalRGroupAction[src]

Auto Trait Implementations

Blanket Implementations

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

impl<T> From<T> for T[src]

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.

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

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

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

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> IntoRequest<T> for T[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,