pub enum Inputs {
Task(TaskInputs),
Workflow(WorkflowInputs),
}Expand description
Represents inputs to a WDL workflow or task.
Variants§
Implementations§
Source§impl Inputs
impl Inputs
Sourcepub fn parse(
document: &Document,
path: impl AsRef<Path>,
) -> Result<Option<(String, Self)>>
pub fn parse( document: &Document, path: impl AsRef<Path>, ) -> Result<Option<(String, Self)>>
Parses an inputs file from the given file path.
The format (JSON or YAML) is determined by the file extension:
.jsonfor JSON format.ymlor.yamlfor YAML format
The parse uses the provided document to validate the input keys within the file.
Returns Ok(Some(_)) if the inputs are not empty.
Returns Ok(None) if the inputs are empty.
Sourcepub fn parse_json(
document: &Document,
path: impl AsRef<Path>,
) -> Result<Option<(String, Self)>>
pub fn parse_json( document: &Document, path: impl AsRef<Path>, ) -> Result<Option<(String, Self)>>
Parses a JSON inputs file from the given file path.
The parse uses the provided document to validate the input keys within the file.
Returns Ok(Some(_)) if the inputs are not empty.
Returns Ok(None) if the inputs are empty.
Sourcepub fn parse_yaml(
document: &Document,
path: impl AsRef<Path>,
) -> Result<Option<(String, Self)>>
pub fn parse_yaml( document: &Document, path: impl AsRef<Path>, ) -> Result<Option<(String, Self)>>
Parses a YAML inputs file from the given file path.
The parse uses the provided document to validate the input keys within the file.
Returns Ok(Some(_)) if the inputs are not empty.
Returns Ok(None) if the inputs are empty.
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Gets the length of all inputs.
For task inputs, this include the inputs, requirements, and hints.
For workflow inputs, this includes the inputs and nested inputs.
Sourcepub fn set(
&mut self,
name: impl Into<String>,
value: impl Into<Value>,
) -> Option<Value>
pub fn set( &mut self, name: impl Into<String>, value: impl Into<Value>, ) -> Option<Value>
Sets an input value.
Returns the previous value, if any.
Sourcepub fn as_task_inputs(&self) -> Option<&TaskInputs>
pub fn as_task_inputs(&self) -> Option<&TaskInputs>
Gets the task inputs.
Returns None if the inputs are for a workflow.
Sourcepub fn as_task_inputs_mut(&mut self) -> Option<&mut TaskInputs>
pub fn as_task_inputs_mut(&mut self) -> Option<&mut TaskInputs>
Gets a mutable reference to task inputs.
Returns None if the inputs are for a workflow.
Sourcepub fn unwrap_task_inputs(self) -> TaskInputs
pub fn unwrap_task_inputs(self) -> TaskInputs
Sourcepub fn as_workflow_inputs(&self) -> Option<&WorkflowInputs>
pub fn as_workflow_inputs(&self) -> Option<&WorkflowInputs>
Gets the workflow inputs.
Returns None if the inputs are for a task.
Sourcepub fn as_workflow_inputs_mut(&mut self) -> Option<&mut WorkflowInputs>
pub fn as_workflow_inputs_mut(&mut self) -> Option<&mut WorkflowInputs>
Gets a mutable reference to workflow inputs.
Returns None if the inputs are for a task.
Sourcepub fn unwrap_workflow_inputs(self) -> WorkflowInputs
pub fn unwrap_workflow_inputs(self) -> WorkflowInputs
Trait Implementations§
Source§impl From<TaskInputs> for Inputs
impl From<TaskInputs> for Inputs
Source§fn from(inputs: TaskInputs) -> Self
fn from(inputs: TaskInputs) -> Self
Source§impl From<WorkflowInputs> for Inputs
impl From<WorkflowInputs> for Inputs
Source§fn from(inputs: WorkflowInputs) -> Self
fn from(inputs: WorkflowInputs) -> Self
Auto Trait Implementations§
impl Freeze for Inputs
impl RefUnwindSafe for Inputs
impl Send for Inputs
impl Sync for Inputs
impl Unpin for Inputs
impl UnsafeUnpin for Inputs
impl UnwindSafe for Inputs
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
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more