pub struct Suspension {
pub id: String,
pub action: String,
pub message: String,
pub parameters: Value,
pub response_schema: Option<Value>,
}Expand description
Generic suspension request for client-side actions.
Fields§
§id: StringUnique suspension ID.
action: StringAction identifier (freeform string, meaning defined by caller).
message: StringHuman-readable message/description.
parameters: ValueAction-specific parameters.
response_schema: Option<Value>Optional JSON Schema for expected response.
Implementations§
Source§impl Suspension
impl Suspension
Sourcepub fn new(id: impl Into<String>, action: impl Into<String>) -> Self
pub fn new(id: impl Into<String>, action: impl Into<String>) -> Self
Create a new suspension with id and action.
Sourcepub fn with_message(self, message: impl Into<String>) -> Self
pub fn with_message(self, message: impl Into<String>) -> Self
Set the message.
Sourcepub fn with_parameters(self, parameters: Value) -> Self
pub fn with_parameters(self, parameters: Value) -> Self
Set the parameters.
Sourcepub fn with_response_schema(self, schema: Value) -> Self
pub fn with_response_schema(self, schema: Value) -> Self
Set the response schema.
Trait Implementations§
Source§impl Clone for Suspension
impl Clone for Suspension
Source§fn clone(&self) -> Suspension
fn clone(&self) -> Suspension
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 moreSource§impl Debug for Suspension
impl Debug for Suspension
Source§impl Default for Suspension
impl Default for Suspension
Source§fn default() -> Suspension
fn default() -> Suspension
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for Suspension
impl<'de> Deserialize<'de> for Suspension
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
Source§impl PartialEq for Suspension
impl PartialEq for Suspension
Source§impl Serialize for Suspension
impl Serialize for Suspension
impl StructuralPartialEq for Suspension
Auto Trait Implementations§
impl Freeze for Suspension
impl RefUnwindSafe for Suspension
impl Send for Suspension
impl Sync for Suspension
impl Unpin for Suspension
impl UnwindSafe for Suspension
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