config::OutputType::File(file)=>file,//TODO: Download to temp file, memmap to str slice and then base64 decode. Also, determine if we need .png or .jpg from header.
config::OutputType::Directory(dir)=>{
//TODO: Implement downloading to temp and renaming to hash
unimplemented!();
},
};*/
lettask=format!("{:?}",path);//TODO: Real task name
prog_send!(linkunwindprog.push_task(&task));
lettemp=tempfile::TempFile::new();
matchperform(&url,&temp,&mutprog).await{
Err(e)=>panic!("Failed downloading {} -> {:?}: {}",url,temp,e),//TODO: Make real error handler
Ok(task)=>{
//TODO: memmap `temp` and decode base64 into new file `path`. also determine the encoding.
prog_send!(linkprog.pop_task(task));
Ok(_)=>{
letpath=matchpath{
config::OutputType::File(file)=>file,
config::OutputType::Directory(dir)=>unimplemented!(),//TODO: implement get hash to file
};
letloli=matchdecode(&temp,&path,&mutprog).await{
Ok(v)=>v,
Err(e)=>panic!("Failed decoding: {}",e),
};
},
}
prog_send!(linkprog.pop_task(task));//TODO: Make sure we don't return gracefully before this is called.