(&mut self, cx: &mut Context<Self>)
| 55 | completion_engine: Option<CompletionEngine>, |
| 56 | cx: &mut Context<Self>, |
| 57 | ) -> Self { |
| 58 | cx.subscribe(&request, |this, _request, _event, cx| { |
| 59 | this.sync_headers_from_request(cx); |
| 60 | cx.notify(); |
| 61 | }) |
| 62 | .detach(); |
| 63 | |
| 64 | let mut editor = Self { |
| 65 | request: Some(request), |
| 66 | header_rows: Vec::new(), |
| 67 | pending_initial_headers: None, |
| 68 | bulk_mode: false, |
| 69 | bulk_editor: None, |
| 70 | focus_handle: cx.focus_handle(), |
| 71 | completion_engine, |
| 72 | }; |
| 73 | |
| 74 | editor.sync_headers_from_request(cx); |
| 75 | |
| 76 | editor |
| 77 | } |
| 78 |