pub struct SignalRGroupAction {
pub group_name: String,
pub user_id: String,
pub action: GroupAction,
}
Expand description
Represents the SignalR group action output binding.
The following binding attributes are supported:
Name | Description |
---|---|
name | The name of the parameter being bound. |
hub_name | The name of the SignalR hub that will receive the group action. |
connection | The 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§
Source§impl Clone for SignalRGroupAction
impl Clone for SignalRGroupAction
Source§fn clone(&self) -> SignalRGroupAction
fn clone(&self) -> SignalRGroupAction
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for SignalRGroupAction
impl Debug for SignalRGroupAction
Source§impl<'de> Deserialize<'de> for SignalRGroupAction
impl<'de> Deserialize<'de> for SignalRGroupAction
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SignalRGroupAction
impl RefUnwindSafe for SignalRGroupAction
impl Send for SignalRGroupAction
impl Sync for SignalRGroupAction
impl Unpin for SignalRGroupAction
impl UnwindSafe for SignalRGroupAction
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request