Commit graph

79 commits

Author SHA1 Message Date
Jiahao XU
88c3f15b3f
Rename Confirmer to UIThread
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-11 12:59:27 +10:00
Jiahao XU
9349fbabdc
Unwrap in Confirmer task if failed to read
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-11 12:59:27 +10:00
Jiahao XU
b2bf065a2b
Rm unused fn helpers::confirm::confirm
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-11 12:59:26 +10:00
Jiahao XU
dd2fa2de33
Impl helpers::confirm::Confirmer
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-11 12:59:26 +10:00
Jiahao XU
c1809d41fa
Refactor: Extract confirm into a new mod
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-11 12:59:22 +10:00
Félix Saparelli
f53680c497
Merge pull request #174 from NobodyXu/fix/find_crate_cratesio 2022-06-11 14:54:50 +12:00
Jiahao XU
1d139324c7
Rewrite untar: Takes a filter fn instead of array
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-10 16:35:51 +10:00
Jiahao XU
a681f3a156
Add debug! logging to untar
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-10 16:18:01 +10:00
Jiahao XU
d2e688c4c2
Fix untar when desired_outputs is not None
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-10 15:49:54 +10:00
Jiahao XU
32ad530329
Rm use of AutoAbortJoinHandle in AsyncExtracter
Since there is no way to abort a blocking thread, using
`AutoAbortJoinHandle` does not add any value.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-10 13:54:43 +10:00
Jiahao XU
1c3a672108
Rm scopeguard creatd for mpsc::Receiver
Since `Receiver` always closes on drop, there is no need to call
`Receiver::close`, which is there so that you can close the mpsc channel
without dropping `Receiver`.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-10 13:52:11 +10:00
Jiahao XU
cadf045d0a
Refactor: Abstract away AsyncExtracter by new fn
`extract_archive_stream`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-09 22:29:33 +10:00
Jiahao XU
00242a40c6
Update doc for AsyncExtracter::new
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-09 22:22:39 +10:00
Jiahao XU
8a812c8d22
Rename AsyncExtracter::write to feed
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-09 22:09:46 +10:00
Jiahao XU
432376224f
Update doc of AsyncExtracter
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-09 22:09:02 +10:00
Jiahao XU
945687c281
Rename AsyncFileWriter to AsyncExtracter
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-09 22:00:00 +10:00
Jiahao XU
e62775a9ec
Add more doc for AsyncFileWriter
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-09 21:34:07 +10:00
Jiahao XU
72983e4113
Use untar in extract_compressed_from_readable
So that we can specify the files we want to extract to avoid io and save
disk usage.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-09 13:26:47 +10:00
Jiahao XU
be5e8616a2
Impl new fn helpers::extracter::untar
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-09 13:15:23 +10:00
Jiahao XU
cc13a23b07
Mark all internal types & fn as pub(crate)
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-09 12:58:39 +10:00
Jiahao XU
c3b5cb11c2
Support for any PkgFmt in AsyncFileWriter
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-09 01:20:37 +10:00
Jiahao XU
58c775a648
Rename mod receiver_as_readable to readable_rx
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-09 01:02:53 +10:00
Jiahao XU
59544e8b55
Use BinstallError in AsyncFileWriter
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-09 01:01:37 +10:00
Jiahao XU
f211788052
Impl ReadableRx in mod receiver_as_readable
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-08 23:04:14 +10:00
Jiahao XU
6bc04340b6
Impl extract_compressed_from_readable and unzip
in new mod `extracter`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-08 22:46:20 +10:00
Jiahao XU
894f9b49f9
Simplify AsyncFileWriter::new: Ret Self
instead of `io::Result<Self>`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-08 22:29:04 +10:00
Jiahao XU
911c52d8e1
Auto remove file in AsyncFileWriter
unless done is called.

Also moves creation of the dir/file into the blocking thread to avoid
blocking.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-08 22:27:19 +10:00
Jiahao XU
5d70f61317
Refactor: Extract AutoAbortJoinHandle
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-08 21:46:32 +10:00
Jiahao XU
358bea5c6d
Refactor: Extract AsyncFileWriter
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-08 21:43:09 +10:00