pub enum WorkflowItem<N: TreeNode = SyntaxNode> {
Input(InputSection<N>),
Output(OutputSection<N>),
Conditional(ConditionalStatement<N>),
Scatter(ScatterStatement<N>),
Call(CallStatement<N>),
Metadata(MetadataSection<N>),
ParameterMetadata(ParameterMetadataSection<N>),
Hints(WorkflowHintsSection<N>),
Declaration(BoundDecl<N>),
}Expand description
Represents an item in a workflow definition.
Variants§
Input(InputSection<N>)
The item is an input section.
Output(OutputSection<N>)
The item is an output section.
Conditional(ConditionalStatement<N>)
The item is a conditional statement.
Scatter(ScatterStatement<N>)
The item is a scatter statement.
Call(CallStatement<N>)
The item is a call statement.
Metadata(MetadataSection<N>)
The item is a metadata section.
ParameterMetadata(ParameterMetadataSection<N>)
The item is a parameter meta section.
Hints(WorkflowHintsSection<N>)
The item is a workflow hints section.
Declaration(BoundDecl<N>)
The item is a private bound declaration.
Implementations§
Source§impl<N: TreeNode> WorkflowItem<N>
impl<N: TreeNode> WorkflowItem<N>
Sourcepub fn can_cast(kind: SyntaxKind) -> bool
pub fn can_cast(kind: SyntaxKind) -> bool
Returns whether or not the given syntax kind can be cast to
WorkflowItem.
Sourcepub fn cast(inner: N) -> Option<Self>
pub fn cast(inner: N) -> Option<Self>
Casts the given node to WorkflowItem.
Returns None if the node cannot be cast.
Sourcepub fn as_input_section(&self) -> Option<&InputSection<N>>
pub fn as_input_section(&self) -> Option<&InputSection<N>>
Attempts to get a reference to the inner InputSection.
- If
selfis aWorkflowItem::Input, then a reference to the innerInputSectionis returned wrapped inSome. - Else,
Noneis returned.
Sourcepub fn into_input_section(self) -> Option<InputSection<N>>
pub fn into_input_section(self) -> Option<InputSection<N>>
Consumes self and attempts to return the inner InputSection.
- If
selfis aWorkflowItem::Input, then the innerInputSectionis returned wrapped inSome. - Else,
Noneis returned.
Sourcepub fn as_output_section(&self) -> Option<&OutputSection<N>>
pub fn as_output_section(&self) -> Option<&OutputSection<N>>
Attempts to get a reference to the inner OutputSection.
- If
selfis aWorkflowItem::Output, then a reference to the innerOutputSectionis returned wrapped inSome. - Else,
Noneis returned.
Sourcepub fn into_output_section(self) -> Option<OutputSection<N>>
pub fn into_output_section(self) -> Option<OutputSection<N>>
Consumes self and attempts to return the inner OutputSection.
- If
selfis aWorkflowItem::Output, then the innerOutputSectionis returned wrapped inSome. - Else,
Noneis returned.
Sourcepub fn as_conditional(&self) -> Option<&ConditionalStatement<N>>
pub fn as_conditional(&self) -> Option<&ConditionalStatement<N>>
Attempts to get a reference to the inner ConditionalStatement.
- If
selfis aWorkflowItem::Conditional, then a reference to the innerConditionalStatementis returned wrapped inSome. - Else,
Noneis returned.
Sourcepub fn into_conditional(self) -> Option<ConditionalStatement<N>>
pub fn into_conditional(self) -> Option<ConditionalStatement<N>>
Consumes self and attempts to return the inner
ConditionalStatement.
- If
selfis aWorkflowItem::Conditional, then the innerConditionalStatementis returned wrapped inSome. - Else,
Noneis returned.
Sourcepub fn as_scatter(&self) -> Option<&ScatterStatement<N>>
pub fn as_scatter(&self) -> Option<&ScatterStatement<N>>
Attempts to get a reference to the inner ScatterStatement.
- If
selfis aWorkflowItem::Scatter, then a reference to the innerScatterStatementis returned wrapped inSome. - Else,
Noneis returned.
Sourcepub fn into_scatter(self) -> Option<ScatterStatement<N>>
pub fn into_scatter(self) -> Option<ScatterStatement<N>>
Consumes self and attempts to return the inner
ScatterStatement.
- If
selfis aWorkflowItem::Scatter, then the innerScatterStatementis returned wrapped inSome. - Else,
Noneis returned.
Sourcepub fn as_call(&self) -> Option<&CallStatement<N>>
pub fn as_call(&self) -> Option<&CallStatement<N>>
Attempts to get a reference to the inner CallStatement.
- If
selfis aWorkflowItem::Call, then a reference to the innerCallStatementis returned wrapped inSome. - Else,
Noneis returned.
Sourcepub fn into_call(self) -> Option<CallStatement<N>>
pub fn into_call(self) -> Option<CallStatement<N>>
Consumes self and attempts to return the inner CallStatement.
- If
selfis aWorkflowItem::Call, then the innerCallStatementis returned wrapped inSome. - Else,
Noneis returned.
Sourcepub fn as_metadata_section(&self) -> Option<&MetadataSection<N>>
pub fn as_metadata_section(&self) -> Option<&MetadataSection<N>>
Attempts to get a reference to the inner MetadataSection.
- If
selfis aWorkflowItem::Metadata, then a reference to the innerMetadataSectionis returned wrapped inSome. - Else,
Noneis returned.
Sourcepub fn into_metadata_section(self) -> Option<MetadataSection<N>>
pub fn into_metadata_section(self) -> Option<MetadataSection<N>>
Consumes self and attempts to return the inner MetadataSection.
- If
selfis aWorkflowItem::Metadata, then the innerMetadataSectionis returned wrapped inSome. - Else,
Noneis returned.
Sourcepub fn as_parameter_metadata_section(
&self,
) -> Option<&ParameterMetadataSection<N>>
pub fn as_parameter_metadata_section( &self, ) -> Option<&ParameterMetadataSection<N>>
Attempts to get a reference to the inner ParameterMetadataSection.
- If
selfis aWorkflowItem::ParameterMetadata, then a reference to the innerParameterMetadataSectionis returned wrapped inSome. - Else,
Noneis returned.
Sourcepub fn into_parameter_metadata_section(
self,
) -> Option<ParameterMetadataSection<N>>
pub fn into_parameter_metadata_section( self, ) -> Option<ParameterMetadataSection<N>>
Consumes self and attempts to return the inner
ParameterMetadataSection.
- If
selfis aWorkflowItem::ParameterMetadata, then the innerParameterMetadataSectionis returned wrapped inSome. - Else,
Noneis returned.
Sourcepub fn as_hints_section(&self) -> Option<&WorkflowHintsSection<N>>
pub fn as_hints_section(&self) -> Option<&WorkflowHintsSection<N>>
Attempts to get a reference to the inner WorkflowHintsSection.
- If
selfis aWorkflowItem::Hints, then a reference to the innerWorkflowHintsSectionis returned wrapped inSome. - Else,
Noneis returned.
Sourcepub fn into_hints_section(self) -> Option<WorkflowHintsSection<N>>
pub fn into_hints_section(self) -> Option<WorkflowHintsSection<N>>
Consumes self and attempts to return the inner
WorkflowHintsSection.
- If
selfis aWorkflowItem::Hints, then the innerWorkflowHintsSectionis returned wrapped inSome. - Else,
Noneis returned.
Sourcepub fn as_declaration(&self) -> Option<&BoundDecl<N>>
pub fn as_declaration(&self) -> Option<&BoundDecl<N>>
Attempts to get a reference to the inner BoundDecl.
- If
selfis aWorkflowItem::Declaration, then a reference to the innerBoundDeclis returned wrapped inSome. - Else,
Noneis returned.
Sourcepub fn into_declaration(self) -> Option<BoundDecl<N>>
pub fn into_declaration(self) -> Option<BoundDecl<N>>
Consumes self and attempts to return the inner BoundDecl.
- If
selfis aWorkflowItem::Declaration, then the innerBoundDeclis returned wrapped inSome. - Else,
Noneis returned.
Sourcepub fn child(node: &N) -> Option<Self>
pub fn child(node: &N) -> Option<Self>
Finds the first child that can be cast to a WorkflowItem.
Sourcepub fn children(node: &N) -> impl Iterator<Item = Self> + use<'_, N>
pub fn children(node: &N) -> impl Iterator<Item = Self> + use<'_, N>
Finds all children that can be cast to a WorkflowItem.
Trait Implementations§
Source§impl<N: Clone + TreeNode> Clone for WorkflowItem<N>
impl<N: Clone + TreeNode> Clone for WorkflowItem<N>
Source§fn clone(&self) -> WorkflowItem<N>
fn clone(&self) -> WorkflowItem<N>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more