MCPcopy Create free account
hub / github.com/bajrangCoder/setu / populate_pending_headers

Method populate_pending_headers

src/components/header_editor.rs:77–105  ·  view source on GitHub ↗
(&mut self, window: &mut Window, cx: &mut Context<Self>)

Source from the content-addressed store, hash-verified

75
76 editor
77 }
78
79 /// Create a header editor not bound to an HTTP request entity.
80 pub fn new_standalone(
81 initial_headers: Vec<Header>,
82 completion_engine: Option<CompletionEngine>,
83 cx: &mut Context<Self>,
84 ) -> Self {
85 let pending = if initial_headers.is_empty() {
86 None
87 } else {
88 Some(
89 initial_headers
90 .into_iter()
91 .map(|h| (h.key, h.value, h.enabled))
92 .collect(),
93 )
94 };
95 Self {
96 request: None,
97 header_rows: Vec::new(),
98 pending_initial_headers: pending,
99 bulk_mode: false,
100 bulk_editor: None,
101 focus_handle: cx.focus_handle(),
102 completion_engine,
103 }
104 }
105
106 fn ensure_bulk_editor(&mut self, window: &mut Window, cx: &mut Context<Self>) {
107 if self.bulk_editor.is_none() {
108 let completion_engine = self.completion_engine.clone();

Callers 1

renderMethod · 0.80

Calls 1

newMethod · 0.45

Tested by

no test coverage detected