Inputs and Outputs
For items to be reusable, its inputs and outputs are API.
Item API
impl<Id> Item for FileDownloadItem<Id>
{
type Params<'exec> = FileDownloadParams<Id>;
type State = FileDownloadState;
// ..
}
Input:
pub struct FileDownloadParams<Id> {
src: Url,
dest: PathBuf,
marker: PhantomData<Id>,
}
Output:
pub enum FileDownloadState {
None,
Some {
path: PathBuf,
md5: Md5Sum,
},
}