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

Method new

src/views/request_view.rs:56–84  ·  view source on GitHub ↗
(
        request: Entity<RequestEntity>,
        initial_body_type: BodyType,
        cx: &mut Context<Self>,
    )

Source from the content-addressed store, hash-verified

54 initial_form_data: Option<HashMap<String, String>>,
55 initial_multipart_data: Option<Vec<MultipartField>>,
56 completion_engine: Option<CompletionEngine>,
57}
58
59impl RequestView {
60 pub fn new(
61 request: Entity<RequestEntity>,
62 initial_body_type: BodyType,
63 cx: &mut Context<Self>,
64 ) -> Self {
65 cx.subscribe(&request, |_this, _request, _event: &RequestEvent, cx| {
66 cx.notify();
67 })
68 .detach();
69
70 Self {
71 request,
72 active_tab: RequestTab::Body,
73 tab_transition: TabTransition::default(),
74 body_editor: None,
75 body_type: initial_body_type,
76 last_applied_body_type: initial_body_type,
77 body_type_selector: None,
78 form_data_editor: None,
79 multipart_form_data_editor: None,
80 header_editor: None,
81 params_editor: None,
82 auth_editor: None,
83 focus_handle: cx.focus_handle(),
84 wrap_lines: true,
85 initial_body_content: None,
86 initial_form_data: None,
87 initial_multipart_data: None,

Callers 7

ensure_body_editorMethod · 0.45
ensure_params_editorMethod · 0.45
ensure_header_editorMethod · 0.45
ensure_auth_editorMethod · 0.45

Calls 1

focus_handleMethod · 0.45

Tested by

no test coverage detected