pub struct Workflow {
pub version: String,
pub name: Option<String>,
pub description: Option<String>,
pub env: Vec<VariableDecl>,
pub conversation: Vec<VariableDecl>,
pub graph: GraphDoc,
}Expand description
A complete workflow document.
Fields§
§version: StringDocument format version.
name: Option<String>§description: Option<String>§env: Vec<VariableDecl>Environment variables (env.*). Values may be omitted and supplied by the host at run time.
conversation: Vec<VariableDecl>Conversation variables (conversation.*), persisted by the host between runs.
graph: GraphDocImplementations§
Source§impl Workflow
impl Workflow
Sourcepub fn from_json(text: &str) -> Result<Self, DocumentError>
pub fn from_json(text: &str) -> Result<Self, DocumentError>
Parse a JSON document.
Sourcepub fn from_yaml(text: &str) -> Result<Self, DocumentError>
pub fn from_yaml(text: &str) -> Result<Self, DocumentError>
Parse a YAML document.
Sourcepub fn parse(text: &str) -> Result<Self, DocumentError>
pub fn parse(text: &str) -> Result<Self, DocumentError>
Parse JSON or YAML, detecting the format from the first non-blank character.
Sourcepub fn from_value(raw: Value) -> Result<Self, DocumentError>
pub fn from_value(raw: Value) -> Result<Self, DocumentError>
Build from an already-decoded JSON value. Fails with the first error;
crate::validate::validate_text reports all of them.
Source§impl Workflow
impl Workflow
Sourcepub fn to_json(&self) -> Result<String, DocumentError>
pub fn to_json(&self) -> Result<String, DocumentError>
Serialize to JSON in the same layout Workflow::from_json accepts.
Sourcepub fn canonical_graph_json(&self) -> Result<String, DocumentError>
pub fn canonical_graph_json(&self) -> Result<String, DocumentError>
Canonical JSON of the graph section (object keys sorted recursively). Used for fingerprints, so key order in the source document does not matter.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Workflow
impl Freeze for Workflowwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<VariableDecl>: Freeze,
PhantomData<NodeDoc>: Freeze,
PhantomData<EdgeDoc>: Freeze,
impl Move for Workflow
impl RefUnwindSafe for Workflow
impl Send for Workflow
impl Sync for Workflow
impl Unpin for Workflow
impl UnsafeUnpin for Workflowwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<VariableDecl>: UnsafeUnpin,
PhantomData<NodeDoc>: UnsafeUnpin,
PhantomData<EdgeDoc>: UnsafeUnpin,
impl UnwindSafe for Workflowwhere
RawVecInner: UnwindSafe,
Arc<str>: UnwindSafe,
Arc<Vec<Value>>: UnwindSafe,
Arc<IndexMap<String, Value>>: UnwindSafe,
Arc<File>: UnwindSafe,
NonNull<u8>: UnwindSafe,
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