瀏覽代碼

Commands, updated function head

Lorenz Bung 8 年之前
父節點
當前提交
9b893e0104
共有 1 個文件被更改,包括 14 次插入0 次删除
  1. 14
    0
      hw6/task2/src/shell.rs

+ 14
- 0
hw6/task2/src/shell.rs 查看文件

@@ -6,13 +6,27 @@ struct Shell<R, W> {
6 6
 }
7 7
 
8 8
 impl Shell<R, W> {
9
+    /// Creates a new Shell.
9 10
     pub fn new(input: R, output: W, name: String) -> Self {
10 11
         Shell {
11 12
             reader = input,
12 13
             writer = output,
14
+            should_exit = false,
13 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 32
 impl BufRead for Shell<R, W> {

Loading…
取消
儲存