Add async_unit_result_context, rename read_collection_file
This commit is contained in:
parent
5055583487
commit
1e9ff1057a
3 changed files with 25 additions and 12 deletions
10
src/error.rs
10
src/error.rs
|
|
@ -29,3 +29,13 @@ pub async fn async_result_context <
|
|||
Err (error) => on_failure (error) ,
|
||||
} ;
|
||||
}
|
||||
|
||||
pub async fn async_unit_result_context <
|
||||
AsyncFunction : Future < Output = Result <()> > ,
|
||||
FailureHandler : Fn (ZoodexError) ,
|
||||
> (
|
||||
function : AsyncFunction ,
|
||||
on_failure : FailureHandler ,
|
||||
) {
|
||||
async_result_context ( function , |_| () , on_failure ) . await ;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue