pub struct Script {
pub label: String,
pub name: String,
pub description: Option<String>,
pub version: Option<String>,
pub parameters: HashMap<String, ParameterDefinition>,
pub functions: Vec<Function>,
pub tags: Vec<String>,
pub created_at: Option<DateTime<Utc>>,
pub updated_at: Option<DateTime<Utc>>,
}Expand description
A Script definition with Functions and parameters
Fields§
§label: StringUser-defined label (unique identifier)
name: StringHuman-readable name
description: Option<String>Optional description
version: Option<String>Version string (optional)
parameters: HashMap<String, ParameterDefinition>Parameter definitions (keyed by parameter name)
functions: Vec<Function>Functions to execute in sequence
Tags for categorization
created_at: Option<DateTime<Utc>>Creation timestamp (server-managed, don’t send from client)
updated_at: Option<DateTime<Utc>>Last update timestamp (server-managed, don’t send from client)
Implementations§
Source§impl Script
impl Script
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Set the description
Sourcepub fn with_version(self, version: impl Into<String>) -> Self
pub fn with_version(self, version: impl Into<String>) -> Self
Set the version
Sourcepub fn with_parameter(self, param: ParameterDefinition) -> Self
pub fn with_parameter(self, param: ParameterDefinition) -> Self
Add a parameter definition
Sourcepub fn with_function(self, function: Function) -> Self
pub fn with_function(self, function: Function) -> Self
Add a Function to the Script
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Script
impl<'de> Deserialize<'de> for Script
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 Script
impl RefUnwindSafe for Script
impl Send for Script
impl Sync for Script
impl Unpin for Script
impl UnwindSafe for Script
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