Struct doh::ops::ListContext
[−]
[src]
pub struct ListContext { /* fields omitted */ }
Main context used to list a server.
Methods
impl ListContext
[src]
pub fn new(starting_url: Url) -> ListContext
[src]
Create a context, starting off at the provided URL.
pub fn one_loop<W: Write>(
&mut self,
out: &mut W,
input: &Getch,
term_size: (usize, usize)
) -> Result<bool>
[src]
&mut self,
out: &mut W,
input: &Getch,
term_size: (usize, usize)
) -> Result<bool>
Do one run of the input loop, effectively resulting in a single action.
Returns Ok(true)
to allow to continue next loop or Ok(false)
to end listing.
Commands
Key | Result |
---|---|
Enter/Right Arrow | enter highlighted entry |
Escape/'Q' /'q' | end |
'D' /'d' | download file |
'U' /'u' | upload file |
Up Arrow | move selection 1 entry up |
Down Arrow | move selection 1 entry down |
Left Arrow | go up one level, if not at root |
Home | set selection to first item |
End | set selection to last item |
Page Up | move selection page's worth of entries up |
Page Down | move selection page's worth of entries down |
Delete | DELETE highlighted entry |
Entering entries
If the entry is a directory, on the next loop the selected subdirectory wll be listed.
If the entry is a UTF-8 file, its contents are paged, see paging_copy()
.
If the entry is a non-UTF-8 file, it is downloaded.
Downloading files
The user is shown a file picker and let choose where to download the file to, then the file is downloaded and saved to the specified location.
The file isn't saved if the user cancels the picker.
A progress bar is shown to the user indicating the download progress.
Uploading files
If the server, in the last RFSAPI request, specified writes_supported
as false
, an error is printed,
and nothing happens.
Otherwise:
The user is shown a file picker and let choose which file to upload,
then the file is streamed to the server via a PUT
request in the currently selected directory,
with the name of the picked file.
The file isn't uploaded if the user cancels the picker.