940 B
940 B
Phase 3
For phase 3 we want to start implementing the close command. We'll get the tar part working but not worry about encryption yet.
- Make a new method
performonDrawerOperationwhich takes&selfand returnsResult<(), DrawerError>. performshould first callvalidateand return the error if there is one.- After that, it should call either
open(&self)orclose(&self)depending on the operation type. For now,openwill just be atodo!() - The new
closemethod should create a vec consisting of the contents of the target directory as a tarball (use the tar create we depend on) - After creating the vec, it should write it out to the drawer file path.
I'm going to add some test data to the project under tests/ but it's just random data to test, ignore the contents of all those files.
Phase 3a
As a minor improvement, make the perform_close method also gzip the contents of the tarball.