rmux-server 0.1.1

Tokio daemon and request dispatcher for the RMUX terminal multiplexer.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
use std::collections::{HashMap, HashSet};

use rmux_core::{
    formats::{render_list_windows_line, FormatContext},
    PaneId, Session,
};
use rmux_proto::{
    CommandOutput, KillWindowResponse, LastWindowResponse, ListWindowsResponse, NewWindowResponse,
    NextWindowResponse, OptionName, PreviousWindowResponse, RenameWindowResponse, RmuxError,
    SelectWindowResponse, SessionName, WindowListEntry, WindowTarget,
};

#[path = "pane_terminals/window_link_commands.rs"]
mod window_link_commands;
#[path = "pane_terminals/window_movement.rs"]
mod window_movement;

use super::{
    session_not_found, HandlerState, KilledWindowResult, NewWindowOptions,
    RemovedWindowHookContext, RespawnWindowOptions, WindowLinkSlot,
};
use crate::format_runtime::RuntimeFormatContext;

impl HandlerState {
    pub(crate) fn create_window(
        &mut self,
        session_name: &SessionName,
        options: NewWindowOptions<'_>,
    ) -> Result<NewWindowResponse, RmuxError> {
        self.create_window_at_requested_index(session_name, None, false, options)
    }

    pub(crate) fn create_window_at_requested_index(
        &mut self,
        session_name: &SessionName,
        target_window_index: Option<u32>,
        insert_at_target: bool,
        options: NewWindowOptions<'_>,
    ) -> Result<NewWindowResponse, RmuxError> {
        let NewWindowOptions {
            name,
            detached,
            spawn,
        } = options;
        let previous_session = self
            .sessions
            .session(session_name)
            .cloned()
            .ok_or_else(|| session_not_found(session_name))?;
        ensure_session_panes_exist(self, session_name, &previous_session)?;
        let size = previous_session.window().size();

        let base_index = self
            .options
            .resolve(Some(session_name), OptionName::BaseIndex)
            .and_then(|value| value.parse::<u32>().ok())
            .unwrap_or(0);
        let pane_id = self.sessions.allocate_pane_id();
        let (window_index, pane_id) = {
            let session = self
                .sessions
                .session_mut(session_name)
                .ok_or_else(|| session_not_found(session_name))?;
            let (window_index, pane_id) = match target_window_index {
                Some(window_index) => {
                    if insert_at_target {
                        session.make_room_for_window(window_index)?;
                    } else if session.window_at(window_index).is_some() {
                        return Err(RmuxError::Server(format!(
                            "create window failed: index {window_index} in use"
                        )));
                    }
                    session.insert_window_with_initial_pane_with_id(window_index, size, pane_id)?;
                    (window_index, pane_id)
                }
                None => {
                    session.create_window_at_or_above_with_pane_id(size, base_index, pane_id)?
                }
            };
            if let Some(name) = name {
                session.rename_window(window_index, name)?;
            }
            if !detached {
                session.select_window(window_index)?;
            }
            (window_index, pane_id)
        };

        if let Err(error) = self.insert_window_terminal(session_name, window_index, spawn) {
            self.replace_session(session_name, previous_session)?;
            return Err(error);
        }

        debug_assert_eq!(
            self.sessions
                .session(session_name)
                .and_then(|session| session.pane_id_in_window(window_index, 0)),
            Some(pane_id)
        );
        self.synchronize_session_group_from(session_name)?;
        self.sync_pane_lifecycle_dimensions_for_session(session_name);

        Ok(NewWindowResponse {
            target: WindowTarget::with_window(session_name.clone(), window_index),
        })
    }

    pub(crate) fn kill_window(
        &mut self,
        target: WindowTarget,
        kill_others: bool,
    ) -> Result<KilledWindowResult, RmuxError> {
        let session_name = target.session_name().clone();
        let target_index = target.window_index();
        let (removal_plan, removed_windows) = {
            let session = self
                .sessions
                .session(&session_name)
                .ok_or_else(|| session_not_found(&session_name))?;
            let removal_plan =
                build_window_removal_plan(self, session, &session_name, target_index, kill_others)?;
            let removed_windows = removal_plan
                .iter()
                .map(|planned_window| {
                    let window = self
                        .sessions
                        .session(&planned_window.session_name)
                        .and_then(|session| session.window_at(planned_window.window_index))
                        .ok_or_else(|| {
                            RmuxError::invalid_target(
                                format!(
                                    "{}:{}",
                                    planned_window.session_name, planned_window.window_index
                                ),
                                "window index does not exist in session",
                            )
                        })?;
                    Ok(RemovedWindowHookContext {
                        target: WindowTarget::with_window(
                            planned_window.session_name.clone(),
                            planned_window.window_index,
                        ),
                        window_id: window.id().as_u32(),
                        window_name: window.name().unwrap_or_default().to_owned(),
                    })
                })
                .collect::<Result<Vec<_>, RmuxError>>()?;
            (removal_plan, removed_windows)
        };
        ensure_window_removal_terminals_exist(self, &removal_plan)?;
        let removed_pane_ids = removal_plan
            .iter()
            .flat_map(|planned_window| planned_window.pane_ids.iter().copied())
            .collect::<Vec<_>>();

        let sessions_to_synchronize = removal_plan
            .iter()
            .map(|planned_window| planned_window.session_name.clone())
            .collect::<HashSet<_>>();
        let mut removed_terminals = HashSet::new();
        for planned_window in removal_plan {
            let planned_target = WindowTarget::with_window(
                planned_window.session_name.clone(),
                planned_window.window_index,
            );
            let _removed_window = self
                .sessions
                .session_mut(&planned_window.session_name)
                .ok_or_else(|| session_not_found(&planned_window.session_name))?
                .remove_window(planned_window.window_index)?;
            let _ = self.options.remove_window(&planned_target);
            let _ = self.hooks.remove_window(&planned_target);
            self.clear_auto_named_window(&planned_window.session_name, planned_window.window_index);
            let _ = self
                .detach_window_link_slot(&planned_window.session_name, planned_window.window_index);

            for pane_id in planned_window.pane_ids {
                if !removed_terminals.insert((planned_window.runtime_session_name.clone(), pane_id))
                {
                    continue;
                }
                if !self.remove_pane_terminal_from_runtime(
                    &planned_window.runtime_session_name,
                    pane_id,
                ) {
                    return Err(RmuxError::Server(format!(
                        "missing pane terminal for pane id {} in session {}",
                        pane_id.as_u32(),
                        planned_window.runtime_session_name
                    )));
                }
            }
        }

        let active_window = self
            .sessions
            .session(&session_name)
            .ok_or_else(|| session_not_found(&session_name))?
            .active_window_index();
        for synchronized_session in sessions_to_synchronize {
            self.synchronize_session_group_from(&synchronized_session)?;
        }

        Ok(KilledWindowResult {
            response: KillWindowResponse {
                target: WindowTarget::with_window(session_name, active_window),
            },
            removed_windows,
            removed_pane_ids,
        })
    }

    pub(crate) fn select_window(
        &mut self,
        target: WindowTarget,
    ) -> Result<SelectWindowResponse, RmuxError> {
        let session = self
            .sessions
            .session_mut(target.session_name())
            .ok_or_else(|| session_not_found(target.session_name()))?;
        // Session::select_window already clears alert flags on the newly-selected window.
        session.select_window(target.window_index())?;

        Ok(SelectWindowResponse { target })
    }

    pub(crate) fn rename_window(
        &mut self,
        target: WindowTarget,
        new_name: String,
    ) -> Result<RenameWindowResponse, RmuxError> {
        {
            let session = self
                .sessions
                .session_mut(target.session_name())
                .ok_or_else(|| session_not_found(target.session_name()))?;
            session.rename_window(target.window_index(), new_name)?;
        }
        self.clear_auto_named_window_family(target.session_name(), target.window_index());
        self.synchronize_linked_window_from_slot(target.session_name(), target.window_index())?;
        self.synchronize_session_group_from(target.session_name())?;

        Ok(RenameWindowResponse { target })
    }

    pub(crate) fn next_window(
        &mut self,
        session_name: &SessionName,
        alerts_only: bool,
    ) -> Result<NextWindowResponse, RmuxError> {
        let session = self
            .sessions
            .session_mut(session_name)
            .ok_or_else(|| session_not_found(session_name))?;
        let window_index = if alerts_only {
            session.next_window_with_alerts()?
        } else {
            session.next_window()?
        };

        Ok(NextWindowResponse {
            target: WindowTarget::with_window(session_name.clone(), window_index),
        })
    }

    pub(crate) fn previous_window(
        &mut self,
        session_name: &SessionName,
        alerts_only: bool,
    ) -> Result<PreviousWindowResponse, RmuxError> {
        let session = self
            .sessions
            .session_mut(session_name)
            .ok_or_else(|| session_not_found(session_name))?;
        let window_index = if alerts_only {
            session.previous_window_with_alerts()?
        } else {
            session.previous_window()?
        };

        Ok(PreviousWindowResponse {
            target: WindowTarget::with_window(session_name.clone(), window_index),
        })
    }

    pub(crate) fn last_window(
        &mut self,
        session_name: &SessionName,
    ) -> Result<LastWindowResponse, RmuxError> {
        let session = self
            .sessions
            .session_mut(session_name)
            .ok_or_else(|| session_not_found(session_name))?;
        let window_index = session.last_window()?;

        Ok(LastWindowResponse {
            target: WindowTarget::with_window(session_name.clone(), window_index),
        })
    }

    pub(crate) fn resize_window(
        &mut self,
        request: rmux_proto::ResizeWindowRequest,
    ) -> Result<rmux_proto::ResizeWindowResponse, RmuxError> {
        let session_name = request.target.session_name().clone();
        let window_index = request.target.window_index();

        self.mutate_session_and_resize_terminals(&session_name, |session| {
            let current_size = session
                .window_at(window_index)
                .ok_or_else(|| {
                    RmuxError::invalid_target(
                        format!("{session_name}:{window_index}"),
                        "window index does not exist in session",
                    )
                })?
                .size();

            let mut sx = current_size.cols;
            let mut sy = current_size.rows;

            if let Some(width) = request.width {
                sx = width;
            }
            if let Some(height) = request.height {
                sy = height;
            }

            if let Some(adjustment) = request.adjustment {
                use rmux_proto::ResizeWindowAdjustment;
                match adjustment {
                    ResizeWindowAdjustment::Left(amount) => {
                        sx = sx.saturating_sub(amount);
                    }
                    ResizeWindowAdjustment::Right(amount) => {
                        sx = sx.saturating_add(amount);
                    }
                    ResizeWindowAdjustment::Up(amount) => {
                        sy = sy.saturating_sub(amount);
                    }
                    ResizeWindowAdjustment::Down(amount) => {
                        sy = sy.saturating_add(amount);
                    }
                }
            }

            sx = sx.max(1);
            sy = sy.max(1);

            session.resize_window(
                window_index,
                rmux_proto::TerminalSize { cols: sx, rows: sy },
            )?;

            Ok(rmux_proto::ResizeWindowResponse {
                target: request.target.clone(),
            })
        })
    }

    pub(crate) fn respawn_window(
        &mut self,
        target: rmux_proto::WindowTarget,
        options: RespawnWindowOptions<'_>,
    ) -> Result<rmux_proto::RespawnWindowResponse, RmuxError> {
        let RespawnWindowOptions { kill, spawn } = options;
        let session_name = target.session_name().clone();
        let window_index = target.window_index();

        // Check that the window exists and collect its pane IDs.
        let pane_ids = {
            let session = self
                .sessions
                .session(&session_name)
                .ok_or_else(|| session_not_found(&session_name))?;
            let window = session.window_at(window_index).ok_or_else(|| {
                RmuxError::invalid_target(
                    format!("{session_name}:{window_index}"),
                    "window index does not exist in session",
                )
            })?;
            window.panes().iter().map(|p| p.id()).collect::<Vec<_>>()
        };

        // Without -k, reject if any pane terminal is still present (i.e. process may be running).
        if !kill
            && pane_ids
                .iter()
                .any(|id| self.ensure_panes_exist(&session_name, &[*id]).is_ok())
        {
            return Err(RmuxError::Server(
                "window still active; use -k to force respawn".to_owned(),
            ));
        }

        let pane_id = pane_ids
            .first()
            .copied()
            .ok_or_else(|| RmuxError::Server("window has no panes".to_owned()))?;
        let runtime_session_name =
            self.runtime_session_name_for_window(&session_name, window_index);

        // Kill terminals for panes that disappear with the old window layout.
        for removed_pane_id in pane_ids.iter().copied().filter(|id| *id != pane_id) {
            self.remove_pane_terminal_from_runtime(&runtime_session_name, removed_pane_id);
        }
        if let Some(pipe) = self.remove_pane_pipe(&runtime_session_name, pane_id) {
            pipe.stop();
        }
        let _ = self.terminals.remove_pane(&runtime_session_name, pane_id);

        // tmux respawns a window by retaining the first pane's identity and
        // destroying the rest, rather than allocating a new pane identity.
        {
            let session = self
                .sessions
                .session_mut(&session_name)
                .ok_or_else(|| session_not_found(&session_name))?;
            session.respawn_window_with_pane_id(window_index, pane_id)?;
            session.select_window(window_index)?;
        }

        // Spawn the new terminal for the single fresh pane.
        self.reset_window_terminal(&session_name, window_index, spawn)?;

        self.synchronize_session_group_from(&session_name)?;
        self.sync_pane_lifecycle_dimensions_for_session(&session_name);

        Ok(rmux_proto::RespawnWindowResponse { target })
    }

    pub(crate) fn list_windows(
        &self,
        session_name: &SessionName,
        format: Option<&str>,
        attached_count: usize,
    ) -> Result<ListWindowsResponse, RmuxError> {
        let session = self
            .sessions
            .session(session_name)
            .ok_or_else(|| session_not_found(session_name))?;
        let windows = collect_window_entries(self, session, session_name, format, attached_count);
        let output = build_command_output(&windows);

        Ok(ListWindowsResponse { windows, output })
    }
}

fn collect_window_entries(
    state: &HandlerState,
    session: &Session,
    session_name: &SessionName,
    format: Option<&str>,
    attached_count: usize,
) -> Vec<WindowListEntry> {
    let active_window = session.active_window_index();
    let last_window = session.last_window_index();
    let session_context =
        FormatContext::from_session(session).with_session_attached(attached_count);

    session
        .windows()
        .iter()
        .map(|(window_index, window)| {
            let active = *window_index == active_window;
            let last = Some(*window_index) == last_window;
            let mut context =
                session_context
                    .clone()
                    .with_window(*window_index, window, active, last);
            if let Some(pane) = window.active_pane() {
                context = context.with_window_pane(window, pane);
            }
            let mut runtime = RuntimeFormatContext::new(context)
                .with_state(state)
                .with_session(session)
                .with_window(*window_index, window);
            if let Some(pane) = window.active_pane() {
                runtime = runtime.with_pane(pane);
            }
            if attached_count == 0 {
                runtime = runtime.with_unclipped_geometry();
            }
            let rendered = render_list_windows_line(&runtime, format);

            WindowListEntry {
                target: WindowTarget::with_window(session_name.clone(), *window_index),
                window_id: window.id().to_string(),
                name: window.name().map(str::to_owned),
                pane_count: u32::try_from(window.pane_count()).expect("pane count fits in u32"),
                size: window.size(),
                layout: window.layout(),
                active,
                last,
                rendered,
            }
        })
        .collect()
}

fn build_command_output(windows: &[WindowListEntry]) -> CommandOutput {
    let stdout = windows
        .iter()
        .map(|window| window.rendered.as_str())
        .collect::<Vec<_>>()
        .join("\n");
    let stdout = if stdout.is_empty() {
        Vec::new()
    } else {
        format!("{stdout}\n").into_bytes()
    };

    CommandOutput::from_stdout(stdout)
}

fn link_window_destination_index(
    session: &Session,
    target_window_index: u32,
    after: bool,
    before: bool,
) -> Result<u32, RmuxError> {
    if !(after || before) {
        return Ok(target_window_index);
    }

    if session.window_at(target_window_index).is_none() {
        return Err(RmuxError::invalid_target(
            format!("{}:{target_window_index}", session.name()),
            "window index does not exist in session",
        ));
    }

    if before {
        Ok(target_window_index)
    } else {
        target_window_index.checked_add(1).ok_or_else(|| {
            RmuxError::Server(format!(
                "window index space exhausted for session {}",
                session.name()
            ))
        })
    }
}

fn request_target_string(target: &rmux_proto::MoveWindowTarget) -> String {
    match target {
        rmux_proto::MoveWindowTarget::Session(session_name) => session_name.to_string(),
        rmux_proto::MoveWindowTarget::Window(target) => target.to_string(),
    }
}

fn window_pane_ids(
    session: &Session,
    session_name: &SessionName,
    window_index: u32,
) -> Result<Vec<PaneId>, RmuxError> {
    let window = session.window_at(window_index).ok_or_else(|| {
        RmuxError::invalid_target(
            format!("{session_name}:{window_index}"),
            "window index does not exist in session",
        )
    })?;

    Ok(window.panes().iter().map(|pane| pane.id()).collect())
}

fn ensure_session_panes_exist(
    state: &HandlerState,
    session_name: &SessionName,
    session: &Session,
) -> Result<(), RmuxError> {
    for (window_index, window) in session.windows() {
        let pane_ids = window
            .panes()
            .iter()
            .map(|pane| pane.id())
            .collect::<Vec<_>>();
        if !pane_ids.is_empty() {
            state.ensure_window_panes_exist(session_name, *window_index, &pane_ids)?;
        }
    }
    Ok(())
}

#[derive(Debug, Clone)]
struct WindowRemovalPlan {
    session_name: SessionName,
    window_index: u32,
    runtime_session_name: SessionName,
    pane_ids: Vec<PaneId>,
}

fn build_window_removal_plan(
    state: &HandlerState,
    session: &Session,
    session_name: &SessionName,
    target_index: u32,
    kill_others: bool,
) -> Result<Vec<WindowRemovalPlan>, RmuxError> {
    window_pane_ids(session, session_name, target_index)?;

    let window_indices = if kill_others {
        session
            .windows()
            .keys()
            .copied()
            .filter(|window_index| *window_index != target_index)
            .collect::<Vec<_>>()
    } else {
        vec![target_index]
    };

    let mut seen_slots = HashSet::new();
    let mut removal_plan = Vec::new();
    for window_index in window_indices {
        let slots = expand_window_removal_slots(
            state,
            state.window_link_slots_for(session_name, window_index),
        );
        for slot in slots {
            if seen_slots.insert(slot.clone()) {
                removal_plan.push(build_window_slot_removal_plan(state, slot)?);
            }
        }
    }
    ensure_window_removal_leaves_survivors(state, &removal_plan)?;
    Ok(removal_plan)
}

fn expand_window_removal_slots(
    state: &HandlerState,
    root_slots: Vec<WindowLinkSlot>,
) -> Vec<WindowLinkSlot> {
    let mut seen = HashSet::new();
    let mut expanded = Vec::new();
    let mut pending = root_slots;

    while let Some(slot) = pending.pop() {
        if !seen.insert(slot.clone()) {
            continue;
        }

        for member in state.sessions.session_group_members(&slot.session_name) {
            pending.push(WindowLinkSlot {
                session_name: member,
                window_index: slot.window_index,
            });
        }
        for linked_slot in state.window_link_slots_for(&slot.session_name, slot.window_index) {
            pending.push(linked_slot);
        }
        expanded.push(slot);
    }

    expanded
}

fn build_window_slot_removal_plan(
    state: &HandlerState,
    slot: WindowLinkSlot,
) -> Result<WindowRemovalPlan, RmuxError> {
    let session = state
        .sessions
        .session(&slot.session_name)
        .ok_or_else(|| session_not_found(&slot.session_name))?;
    Ok(WindowRemovalPlan {
        runtime_session_name: state
            .runtime_session_name_for_window(&slot.session_name, slot.window_index),
        pane_ids: window_pane_ids(session, &slot.session_name, slot.window_index)?,
        session_name: slot.session_name,
        window_index: slot.window_index,
    })
}

fn ensure_window_removal_leaves_survivors(
    state: &HandlerState,
    removal_plan: &[WindowRemovalPlan],
) -> Result<(), RmuxError> {
    let mut removals_by_session = HashMap::<SessionName, usize>::new();
    for planned_window in removal_plan {
        *removals_by_session
            .entry(planned_window.session_name.clone())
            .or_default() += 1;
    }

    for (session_name, removed_count) in removals_by_session {
        let session = state
            .sessions
            .session(&session_name)
            .ok_or_else(|| session_not_found(&session_name))?;
        if session.windows().len() <= removed_count {
            return Err(RmuxError::Server(format!(
                "cannot kill the only window in session {session_name}"
            )));
        }
    }

    Ok(())
}

fn ensure_window_removal_terminals_exist(
    state: &HandlerState,
    removal_plan: &[WindowRemovalPlan],
) -> Result<(), RmuxError> {
    let mut panes_by_runtime = HashMap::<SessionName, Vec<PaneId>>::new();
    for planned_window in removal_plan {
        panes_by_runtime
            .entry(planned_window.runtime_session_name.clone())
            .or_default()
            .extend(planned_window.pane_ids.iter().copied());
    }

    for (runtime_session_name, pane_ids) in panes_by_runtime {
        state
            .terminals
            .ensure_panes_exist(&runtime_session_name, &pane_ids)?;
    }

    Ok(())
}