pub struct SetVariablesRequest<T: SetVariablesRequestState> { /* private fields */ }Expand description
Request to update variables for a particular scope
§Variable Scoping
Variables can be set either locally or hierarchically:
- Local: Variables only visible in specified scope
- Hierarchical: Variables propagate up to parent scopes
§Examples
Two scopes with variables:
- Scope 1:
{ "foo": 2 } - Scope 2:
{ "bar": 1 }
Setting { "foo": 5 } in scope 2:
- Local=true: Scope 2 becomes
{ "bar": 1, "foo": 5 }, Scope 1 unchanged - Local=false: Scope 1 becomes
{ "foo": 5 }, Scope 2 unchanged
ⓘ
#[derive(Serialize)]
struct Foo {
bar: String
}
client
.set_variables()
.with_element_instance_key(123456)
.with_variable(Foo {bar: String::from("foobar")})
.send()
.await?;Implementations§
Source§impl SetVariablesRequest<Initial>
impl SetVariablesRequest<Initial>
Sourcepub fn with_element_instance_key(
self,
element_instance_key: i64,
) -> SetVariablesRequest<WithInstanceKey>
pub fn with_element_instance_key( self, element_instance_key: i64, ) -> SetVariablesRequest<WithInstanceKey>
Source§impl SetVariablesRequest<WithInstanceKey>
impl SetVariablesRequest<WithInstanceKey>
Sourcepub fn with_variable<T: Serialize>(
self,
data: T,
) -> Result<SetVariablesRequest<WithVariables>, ClientError>
pub fn with_variable<T: Serialize>( self, data: T, ) -> Result<SetVariablesRequest<WithVariables>, ClientError>
Source§impl SetVariablesRequest<WithVariables>
impl SetVariablesRequest<WithVariables>
Sourcepub async fn send(self) -> Result<SetVariablesResponse, ClientError>
pub async fn send(self) -> Result<SetVariablesResponse, ClientError>
Sourcepub fn with_operation_reference(self, operation_reference: u64) -> Self
pub fn with_operation_reference(self, operation_reference: u64) -> Self
Sourcepub fn set_local_scope(self, is_local_scope: bool) -> Self
pub fn set_local_scope(self, is_local_scope: bool) -> Self
Trait Implementations§
Source§impl<T: Clone + SetVariablesRequestState> Clone for SetVariablesRequest<T>
impl<T: Clone + SetVariablesRequestState> Clone for SetVariablesRequest<T>
Source§fn clone(&self) -> SetVariablesRequest<T>
fn clone(&self) -> SetVariablesRequest<T>
Returns a duplicate 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 moreAuto Trait Implementations§
impl<T> !Freeze for SetVariablesRequest<T>
impl<T> !RefUnwindSafe for SetVariablesRequest<T>
impl<T> Send for SetVariablesRequest<T>where
T: Send,
impl<T> Sync for SetVariablesRequest<T>where
T: Sync,
impl<T> Unpin for SetVariablesRequest<T>where
T: Unpin,
impl<T> !UnwindSafe for SetVariablesRequest<T>
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