Ver código fonte

Commands, updated function head

Lorenz Bung 8 anos atrás
pai
commit
9b893e0104
1 arquivos alterados com 14 adições e 0 exclusões
  1. 14
    0
      hw6/task2/src/shell.rs

+ 14
- 0
hw6/task2/src/shell.rs Ver arquivo

6
 }
6
 }
7
 
7
 
8
 impl Shell<R, W> {
8
 impl Shell<R, W> {
9
+    /// Creates a new Shell.
9
     pub fn new(input: R, output: W, name: String) -> Self {
10
     pub fn new(input: R, output: W, name: String) -> Self {
10
         Shell {
11
         Shell {
11
             reader = input,
12
             reader = input,
12
             writer = output,
13
             writer = output,
14
+            should_exit = false,
13
             name = name,
15
             name = name,
14
         }
16
         }
15
     }
17
     }
18
+    /// Initializes the Shell Loop
19
+    pub fn start() -> Result<Self, &str> {
20
+    }
21
+    /// Waits for user inputs.
22
+    fn shell_loop() -> Result {
23
+    }
24
+    /// Prints the shell prompt.
25
+    fn prompt() -> Result<Option, &str> {
26
+    }
27
+    /// Runs a command.
28
+    fn run(&str) {
29
+    }
16
 }
30
 }
17
 
31
 
18
 impl BufRead for Shell<R, W> {
32
 impl BufRead for Shell<R, W> {

Carregando…
Cancelar
Salvar