id stringlengths 20 30 | source stringclasses 1
value | chunk_index int64 0 520k | token_count int32 154 512 | content stringlengths 185 57.5k |
|---|---|---|---|---|
rust_dataset_chunk_519400 | rust_dataset.txt | 519,400 | 512 | ,
}),
LayoutInfo::Stringified(stringified_layout) => Ok(ProtobufLayoutInfo {
source: "stringified".to_owned(),
name: stringified_layout.clone(),
layout_metadata: None,
}),
}
}
}
impl TryFrom<ProtobufLayoutInfo> for LayoutIn... |
rust_dataset_chunk_519401 | rust_dataset.txt | 519,401 | 512 | map(|p| p.try_into())
.collect::<Result<Vec<_>, _>>()?;
Ok(TabMetadata {
panes,
name: protobuf_metadata.name,
})
}
}
impl TryFrom<TabMetadata> for ProtobufTabMetadata {
type Error = &'static str;
fn try_from(metadata: TabMetadata) -> Result<Self, &'static... |
rust_dataset_chunk_519402 | rust_dataset.txt | 519,402 | 512 | ParsingError) -> Result<Self, Self::Error> {
match protobuf.error_type.ok_or("Missing error_type")? {
ProtobufLayoutParsingErrorType::KdlError(kdl_variant) => {
Ok(crate::data::LayoutParsingError::KdlError {
kdl_error: kdl_variant
.kdl_erro... |
rust_dataset_chunk_519403 | rust_dataset.txt | 519,403 | 512 | {
Ok(ProtobufKdlError {
error_message: kdl.error_message,
// src is not serialized
offset: kdl.offset.map(|o| o as u64),
len: kdl.len.map(|l| l as u64),
help_message: kdl.help_message,
})
}
}
impl TryFrom<CopyDestination> for ProtobufCopy... |
rust_dataset_chunk_519404 | rust_dataset.txt | 519,404 | 512 | },
Some(MouseEventName::MouseScrollRight) => {
match mouse_event_payload.mouse_event_payload {
Some(mouse_event_payload::MouseEventPayload::LineCount(line_count)) => {
Ok(Mouse::ScrollRight(line_count as usize))
},
... |
rust_dataset_chunk_519405 | rust_dataset.txt | 519,405 | 512 | Mouse::ScrollUp(number_of_lines) => Ok(MouseEventPayload {
mouse_event_name: MouseEventName::MouseScrollUp as i32,
mouse_event_payload: Some(mouse_event_payload::MouseEventPayload::LineCount(
number_of_lines as u32,
)),
..Default::defa... |
rust_dataset_chunk_519406 | rust_dataset.txt | 519,406 | 512 | Position(
ProtobufPosition {
line: line as i64,
column: column as i64,
},
)),
..Default::default()
}),
Mouse::Hover(line, column) => Ok(MouseEventPayload {
mous... |
rust_dataset_chunk_519407 | rust_dataset.txt | 519,407 | 512 | (|position| (position.column as usize, position.line as usize)),
terminal_command: protobuf_pane_info.terminal_command,
plugin_url: protobuf_pane_info.plugin_url,
is_selectable: protobuf_pane_info.is_selectable,
index_in_pane_group: protobuf_pane_info
.ind... |
rust_dataset_chunk_519408 | rust_dataset.txt | 519,408 | 512 | ,
cursor_coordinates_in_pane: pane_info.cursor_coordinates_in_pane.map(|(x, y)| {
ProtobufPosition {
column: x as i64,
line: y as i64,
}
}),
terminal_command: pane_info.terminal_command,
plugin_url: p... |
rust_dataset_chunk_519409 | rust_dataset.txt | 519,409 | 512 | _columns: protobuf_tab_info.display_area_columns as usize,
selectable_tiled_panes_count: protobuf_tab_info.selectable_tiled_panes_count as usize,
selectable_floating_panes_count: protobuf_tab_info.selectable_floating_panes_count
as usize,
tab_id: protobuf_tab_info.tab... |
rust_dataset_chunk_519410 | rust_dataset.txt | 519,410 | 512 | From<ProtobufModeUpdatePayload> for ModeInfo {
type Error = &'static str;
fn try_from(
mut protobuf_mode_update_payload: ProtobufModeUpdatePayload,
) -> Result<Self, &'static str> {
let current_mode: InputMode =
ProtobufInputMode::try_from(protobuf_mode_update_payload.current_mod... |
rust_dataset_chunk_519411 | rust_dataset.txt | 519,411 | 512 | p| p.into());
let session_dimmed = protobuf_mode_update_payload.session_dimmed;
let session_ancestry = protobuf_mode_update_payload.ancestry;
let host_fullscreen = protobuf_mode_update_payload.host_fullscreen;
let nested_ascend_keys = protobuf_mode_update_payload
.nested_... |
rust_dataset_chunk_519412 | rust_dataset.txt | 519,412 | 512 | ane_group = mode_info.currently_marking_pane_group;
let is_web_client = mode_info.is_web_client;
let web_server_ip = mode_info.web_server_ip.map(|i| format!("{}", i));
let web_server_port = mode_info.web_server_port.map(|p| p as u32);
let web_server_capability = mode_info.web_server_capa... |
rust_dataset_chunk_519413 | rust_dataset.txt | 519,413 | 512 | _name_list
.event_types
.iter()
.filter_map(|i| ProtobufEventType::try_from(*i).ok())
.collect();
let event_types: Vec<EventType> = event_types
.iter()
.filter_map(|e| EventType::try_from(*e).ok())
.collect();
Ok(event_t... |
rust_dataset_chunk_519414 | rust_dataset.txt | 519,414 | 512 | PaneExited => EventType::CommandPaneExited,
ProtobufEventType::PaneClosed => EventType::PaneClosed,
ProtobufEventType::EditPaneOpened => EventType::EditPaneOpened,
ProtobufEventType::EditPaneExited => EventType::EditPaneExited,
ProtobufEventType::CommandPaneReRun => Event... |
rust_dataset_chunk_519415 | rust_dataset.txt | 519,415 | 512 | ::SoftKeyboardVisibilityChanged => {
EventType::SoftKeyboardVisibilityChanged
},
ProtobufEventType::HintText => EventType::HintText,
ProtobufEventType::ActivePaneScroll => EventType::ActivePaneScroll,
ProtobufEventType::NestedSessionModeUpdate => EventType... |
rust_dataset_chunk_519416 | rust_dataset.txt | 519,416 | 512 | SessionUpdate,
EventType::RunCommandResult => ProtobufEventType::RunCommandResult,
EventType::WebRequestResult => ProtobufEventType::WebRequestResult,
EventType::CommandPaneOpened => ProtobufEventType::CommandPaneOpened,
EventType::CommandPaneExited => ProtobufEventType::... |
rust_dataset_chunk_519417 | rust_dataset.txt | 519,417 | 512 | ,
EventType::HighlightClicked => ProtobufEventType::HighlightClicked,
EventType::InitialKeybinds => ProtobufEventType::InitialKeybinds,
EventType::HostTerminalThemeChanged => ProtobufEventType::HostTerminalThemeChanged,
EventType::SoftKeyboardVisibilityChanged => {
... |
rust_dataset_chunk_519418 | rust_dataset.txt | 519,418 | 512 | TerminalThemeMode::Dark => ProtobufHostTerminalThemeIndication::Dark,
HostTerminalThemeMode::Light => ProtobufHostTerminalThemeIndication::Light,
}
}
}
impl From<ProtobufHostTerminalThemeIndication> for HostTerminalThemeMode {
fn from(mode: ProtobufHostTerminalThemeIndication) -> Self {
... |
rust_dataset_chunk_519419 | rust_dataset.txt | 519,419 | 512 | let protobuf_event: ProtobufEvent = mode_update_event.clone().try_into().unwrap();
let serialized_protobuf_event = protobuf_event.encode_to_vec();
let deserialized_protobuf_event: ProtobufEvent =
Message::decode(serialized_protobuf_event.as_slice()).unwrap();
let deserialized_event: Event = deseria... |
rust_dataset_chunk_519420 | rust_dataset.txt | 519,420 | 512 | EightBit(2),
blue: PaletteColor::EightBit(2),
magenta: PaletteColor::EightBit(2),
cyan: PaletteColor::EightBit(2),
white: PaletteColor::EightBit(2),
orange: PaletteColor::EightBit(2),
gray: PaletteColor::EightBit(2),
... |
rust_dataset_chunk_519421 | rust_dataset.txt | 519,421 | 512 | });
let protobuf_event: ProtobufEvent = mode_update_event.clone().try_into().unwrap();
let serialized_protobuf_event = protobuf_event.encode_to_vec();
let deserialized_protobuf_event: ProtobufEvent =
Message::decode(serialized_protobuf_event.as_slice()).unwrap();
let deserialized_event: Event =... |
rust_dataset_chunk_519422 | rust_dataset.txt | 519,422 | 512 | false,
is_sync_panes_active: true,
are_floating_panes_visible: true,
other_focused_clients: vec![1, 5, 111],
other_focused_client_slots: vec![1, 2, 3],
active_swap_layout_name: None,
is_swap_layout_dirty: true,
viewport_rows: 10,
... |
rust_dataset_chunk_519423 | rust_dataset.txt | 519,423 | 512 | obufEvent = hint_text_event.clone().try_into().unwrap();
let serialized_protobuf_event = protobuf_event.encode_to_vec();
let deserialized_protobuf_event: ProtobufEvent =
Message::decode(serialized_protobuf_event.as_slice()).unwrap();
let deserialized_event: Event = deserialized_protobuf_event.try_in... |
rust_dataset_chunk_519424 | rust_dataset.txt | 519,424 | 512 | _into().unwrap();
assert_eq!(
mouse_event, deserialized_event,
"Event properly serialized/deserialized without change"
);
}
#[test]
fn serialize_mouse_event_without_position() {
use prost::Message;
let mouse_event = Event::Mouse(Mouse::ScrollUp(17));
let protobuf_event: ProtobufEven... |
rust_dataset_chunk_519425 | rust_dataset.txt | 519,425 | 512 | let deserialized_event: Event = deserialized_protobuf_event.try_into().unwrap();
assert_eq!(
copy_event, deserialized_event,
"Event properly serialized/deserialized without change"
);
}
#[test]
fn serialize_input_received_event() {
use prost::Message;
let input_received_event = Even... |
rust_dataset_chunk_519426 | rust_dataset.txt | 519,426 | 512 | let serialized_protobuf_event = protobuf_event.encode_to_vec();
let deserialized_protobuf_event: ProtobufEvent =
Message::decode(serialized_protobuf_event.as_slice()).unwrap();
let deserialized_event: Event = deserialized_protobuf_event.try_into().unwrap();
assert_eq!(
file_system_event,... |
rust_dataset_chunk_519427 | rust_dataset.txt | 519,427 | 512 | = deserialized_protobuf_event.try_into().unwrap();
assert_eq!(
file_system_event, deserialized_event,
"Event properly serialized/deserialized without change"
);
}
#[test]
fn serialize_session_update_event() {
use prost::Message;
let session_update_event = Event::SessionUpdate(Default::... |
rust_dataset_chunk_519428 | rust_dataset.txt | 519,428 | 512 | : true,
viewport_rows: 10,
viewport_columns: 10,
display_area_rows: 10,
display_area_columns: 10,
selectable_tiled_panes_count: 10,
selectable_floating_panes_count: 10,
tab_id: 1,
has_bell_notification: false,
is... |
rust_dataset_chunk_519429 | rust_dataset.txt | 519,429 | 512 | is_suppressed: false,
is_collapsed: true,
title: "pane 1".to_owned(),
exited: false,
exit_status: None,
is_held: false,
pane_x: 0,
pane_content_x: 1,
pane_y: 0,
pane_content_y: 1,
pane_row... |
rust_dataset_chunk_519430 | rust_dataset.txt | 519,430 | 512 | plugins,
web_clients_allowed: false,
web_client_count: 1,
tab_history,
pane_history: Default::default(),
creation_time: Duration::from_secs(100),
attention_muted: Default::default(),
};
let session_info_2 = SessionInfo {
name: "session 2".to_owned(... |
rust_dataset_chunk_519431 | rust_dataset.txt | 519,431 | 512 | _pane_id: ProtobufPaneId) -> Result<Self, &'static str> {
match ProtobufPaneType::try_from(protobuf_pane_id.pane_type).ok() {
Some(ProtobufPaneType::Terminal) => Ok(PaneId::Terminal(protobuf_pane_id.id)),
Some(ProtobufPaneType::Plugin) => Ok(PaneId::Plugin(protobuf_pane_id.id)),
... |
rust_dataset_chunk_519432 | rust_dataset.txt | 519,432 | 512 | }
}
}
impl Into<crate::input::options::PaneFrameStyle> for ProtobufPaneFrameStyle {
fn into(self) -> crate::input::options::PaneFrameStyle {
match self {
ProtobufPaneFrameStyle::Full => crate::input::options::PaneFrameStyle::Full,
ProtobufPaneFrameStyle::Titles => crate::input:... |
rust_dataset_chunk_519433 | rust_dataset.txt | 519,433 | 512 | <ProtobufPaneRenderReportPayload> for HashMap<PaneId, PaneContents> {
type Error = &'static str;
fn try_from(protobuf_payload: ProtobufPaneRenderReportPayload) -> Result<Self, &'static str> {
let mut pane_contents_map = HashMap::new();
for entry in protobuf_payload.pane_contents {
l... |
rust_dataset_chunk_519434 | rust_dataset.txt | 519,434 | 512 | transpose()?;
let cursor = pane_contents.cursor.map(|(x, y)| ProtobufPosition {
line: y as i64,
column: x as i64,
});
Ok(ProtobufPaneContents {
viewport: pane_contents.viewport,
selected_text,
lines_above_viewport: pane_contents.lines_... |
rust_dataset_chunk_519435 | rust_dataset.txt | 519,435 | 512 | ProtobufNestedSessionKeybindsError::NestedKeybindsGuestGone
},
NestedSessionKeybindsError::TooLarge => {
ProtobufNestedSessionKeybindsError::NestedKeybindsTooLarge
},
NestedSessionKeybindsError::Timeout => {
ProtobufNestedSessionKeybindsError::NestedKeybindsTimeo... |
rust_dataset_chunk_519436 | rust_dataset.txt | 519,436 | 512 | binds),
keybinds_generation: nested_session_keybinds.keybinds_generation,
})
},
Err(error) => Response::Err(nested_session_keybinds_error_to_protobuf(error) as i32),
};
Ok(ProtobufNestedSessionKeybindsResponse {
response: Some(response_field),
})
}
pub fn... |
rust_dataset_chunk_519437 | rust_dataset.txt | 519,437 | 512 | fn try_from(selected_text: SelectedText) -> Result<Self, &'static str> {
Ok(ProtobufSelectedText {
start: Some(selected_text.start.try_into()?),
end: Some(selected_text.end.try_into()?),
})
}
}
#[test]
fn serialize_nested_session_mode_update_event() {
use prost::Message... |
rust_dataset_chunk_519438 | rust_dataset.txt | 519,438 | 512 | ::Normal,
vec![(
KeyWithModifier::new(BareKey::Char('g')).with_ctrl_modifier(),
vec![Action::SwitchToMode {
input_mode: InputMode::Pane,
}],
)],
),
(
InputMode::Pan... |
rust_dataset_chunk_519439 | rust_dataset.txt | 519,439 | 512 | Vec = vec![
(
InputMode::Normal,
vec![
(
KeyWithModifier::new(BareKey::Char('p')).with_ctrl_modifier(),
vec![Action::SwitchToMode {
input_mode: InputMode::Pane,
}],
),
... |
rust_dataset_chunk_519440 | rust_dataset.txt | 519,440 | 512 | ::default()
}),
Event::TabUpdate(vec![TabInfo {
name: "tab".to_owned(),
active: true,
..Default::default()
}]),
Event::InputReceived,
];
for event in events {
let bytes = ProtobufEvent::try_from(event.clone())
.unwrap()
... |
rust_dataset_chunk_519441 | rust_dataset.txt | 519,441 | 512 | resetWithError> for ProtobufKeybindPresetWithError {
fn from(preset: KeybindPresetWithError) -> Self {
ProtobufKeybindPresetWithError {
name: preset.name,
path: preset.path,
error: preset.error,
}
}
}
impl From<ProtobufKeybindPresetWithError> for KeybindPrese... |
rust_dataset_chunk_519442 | rust_dataset.txt | 519,442 | 512 | > for ContextMenuAction {
type Error = &'static str;
fn try_from(protobuf_action: ProtobufContextMenuAction) -> Result<Self, &'static str> {
match protobuf_action.action {
Some(ProtobufContextMenuActionKind::Plain(action)) => {
Ok(ContextMenuAction::Action(Action::try_from(ac... |
rust_dataset_chunk_519443 | rust_dataset.txt | 519,443 | 512 | ) => {
ClickedTabAction::Move(Direction::Left)
},
Ok(ProtobufClickedTabAction::MoveRight) => {
ClickedTabAction::Move(Direction::Right)
},
Ok(ProtobufClickedTabAction::Mute) => ClickedTabActio... |
rust_dataset_chunk_519444 | rust_dataset.txt | 519,444 | 512 | Pane(action as i32)
},
ContextMenuAction::ClickedTab(ClickedTabAction::MoveToPosition(position)) => {
ProtobufContextMenuActionKind::ClickedTabMoveToPosition(position)
},
ContextMenuAction::ClickedTab(action) => {
let action = match action ... |
rust_dataset_chunk_519445 | rust_dataset.txt | 519,445 | 512 | (ClickedTabAction::StartRename),
ContextMenuAction::ClickedTab(ClickedTabAction::Move(Direction::Left)),
ContextMenuAction::ClickedTab(ClickedTabAction::Move(Direction::Right)),
ContextMenuAction::ClickedTab(ClickedTabAction::MoveToPosition(0)),
ContextMenuAction::Clicked... |
rust_dataset_chunk_519446 | rust_dataset.txt | 519,446 | 512 | tab_index: Some(1),
tab_id: Some(4),
tab_count: 3,
line: 2,
column: 7,
client_id: 1,
paste_shortcut: Some("Ctrl Shift v".to_owned()),
};
let entries = vec![
ContextMenuEntry::item(
"Close tab"... |
rust_dataset_chunk_519447 | rust_dataset.txt | 519,447 | 512 | () {
let session = SessionInfo {
name: "muted".to_owned(),
attention_muted: true,
..Default::default()
};
round_trip(Event::SessionUpdate(vec![session], vec![]));
}
#[test]
fn pane_attention_changed_round_trips() {
round_trip(Event::PaneAt... |
rust_dataset_chunk_519448 | rust_dataset.txt | 519,448 | 512 | i32) -> FolderRelation {
match pb::FolderRelation::try_from(value) {
Ok(pb::FolderRelation::Here) => FolderRelation::Here,
Ok(pb::FolderRelation::Subfolder) => FolderRelation::Subfolder,
_ => FolderRelation::Other,
}
}
impl From<SessionSuggestion> for pb::Se... |
rust_dataset_chunk_519449 | rust_dataset.txt | 519,449 | 512 | from(s: pb::SessionSuggestionItem) -> Self {
SessionSuggestion {
name: s.name,
is_running: s.is_running,
last_used_secs_ago: s.last_used_secs_ago,
created_secs_ago: s.created_secs_ago,
folder: s.folder,
folder_r... |
rust_dataset_chunk_519450 | rust_dataset.txt | 519,450 | 512 | _matching: c.resumable_matching,
}
}
}
impl From<pb::SessionCountsUpdatePayload> for SessionCounts {
fn from(c: pb::SessionCountsUpdatePayload) -> Self {
SessionCounts {
running: c.running,
resumable_matching: c.resumable_matching,
... |
rust_dataset_chunk_519451 | rust_dataset.txt | 519,451 | 512 | PreviewPayload> for SessionPreview {
fn from(p: pb::SessionPreviewPayload) -> Self {
SessionPreview {
session_name: p.session_name,
tab_index: p.tab_index.map(|i| i as usize),
active_tab_index: p.active_tab_index.map(|i| i as usize),
ta... |
rust_dataset_chunk_519452 | rust_dataset.txt | 519,452 | 512 | t.name,
focused: t.focused,
panes: t
.panes
.into_iter()
.map(|pane| SavedPanePreview {
title: pane.title,
command: pane.co... |
rust_dataset_chunk_519453 | rust_dataset.txt | 519,453 | 512 | ()],
}));
round_trip(Event::SessionCountsUpdate(SessionCounts {
running: 2,
resumable_matching: 1,
}));
round_trip(Event::FolderSessionsUpdate(FolderSessions {
folder: "/a/".to_owned(),
running: vec!["r".to_o... |
rust_dataset_chunk_519454 | rust_dataset.txt | 519,454 | 512 | PaneAddress, &'static str> {
Ok(PaneAddress {
host: address.host.map(HostId),
session: address.session,
pane_id: address
.pane_id
.ok_or("PaneAddress without a pane id")?
.try_into()?,
})
}
fn mirror_closed_reason_to_protobuf(reason: MirrorClosedReaso... |
rust_dataset_chunk_519455 | rust_dataset.txt | 519,455 | 512 | Viewer
},
Some(ProtobufMirrorClosedReason::MirrorRejected) | None => MirrorClosedReason::Rejected,
}
}
fn mirror_state_to_protobuf(state: MirrorState) -> ProtobufMirrorState {
match state {
MirrorState::NoTarget => ProtobufMirrorState {
kind: ProtobufMirrorStateKind::MirrorN... |
rust_dataset_chunk_519456 | rust_dataset.txt | 519,456 | 512 | Ok(ProtobufLiveViewRelease::Key) => Ok(LiveViewRelease::Key),
Ok(ProtobufLiveViewRelease::ClickOutside) => Ok(LiveViewRelease::ClickOutside),
Ok(ProtobufLiveViewRelease::FocusLost) => Ok(LiveViewRelease::FocusLost),
Ok(ProtobufLiveViewRelease::Plugin) => Ok(LiveViewRelease::Plugin),
... |
rust_dataset_chunk_519457 | rust_dataset.txt | 519,457 | 512 | true,
Some(crate::pane_size::Size { cols: 80, rows: 24 }),
),
(
false,
false,
true,
false,
Some(crate::... |
rust_dataset_chunk_519458 | rust_dataset.txt | 519,458 | 512 | PluginSettingsEntries.try_into().unwrap();
assert_eq!(
EventType::try_from(protobuf).unwrap(),
EventType::PluginSettingsEntries
);
}
}
#[cfg(test)]
mod unreadable_event_tests {
use super::*;
use crate::data::{InputMode, ModeInfo, Mouse};
use prost::Message;
... |
rust_dataset_chunk_519459 | rust_dataset.txt | 519,459 | 512 | l| l as usize);
let cwd = protobuf_file.cwd.map(|c| PathBuf::from(c));
Ok(FileToOpen {
path,
line_number,
cwd,
border_style: protobuf_file.border_style.map(BorderStyleOverride::from),
})
}
}
impl TryFrom<FileToOpen> for ProtobufFile {
type... |
rust_dataset_chunk_519460 | rust_dataset.txt | 519,460 | 512 | }
impl TryFrom<InputMode> for ProtobufInputMode {
type Error = &'static str;
fn try_from(input_mode: InputMode) -> Result<Self, &'static str> {
Ok(match input_mode {
InputMode::Normal => ProtobufInputMode::Normal,
InputMode::Locked => ProtobufInputMode::Locked,
Input... |
rust_dataset_chunk_519461 | rust_dataset.txt | 519,461 | 512 | BTreeSet;
use std::convert::TryFrom;
impl TryFrom<ProtobufMainKey> for BareKey {
type Error = &'static str;
fn try_from(protobuf_main_key: ProtobufMainKey) -> Result<Self, &'static str> {
match protobuf_main_key {
ProtobufMainKey::Char(character) => Ok(BareKey::Char(char_index_to_char(chara... |
rust_dataset_chunk_519462 | rust_dataset.txt | 519,462 | 512 | ::Tab => Ok(ProtobufMainKey::Key(ProtobufNamedKey::Tab as i32)),
BareKey::Esc => Ok(ProtobufMainKey::Key(ProtobufNamedKey::Esc as i32)),
BareKey::Enter => Ok(ProtobufMainKey::Key(ProtobufNamedKey::Enter as i32)),
BareKey::CapsLock => Ok(ProtobufMainKey::Key(ProtobufNamedKey::CapsLock... |
rust_dataset_chunk_519463 | rust_dataset.txt | 519,463 | 512 | ok_or("Key must have main_key")?
.try_into()?;
let mut key_modifiers = BTreeSet::new();
if let Some(main_modifier) = protobuf_key.modifier {
key_modifiers.insert(
ProtobufKeyModifier::try_from(main_modifier)
.ok()
.ok_or("in... |
rust_dataset_chunk_519464 | rust_dataset.txt | 519,464 | 512 | as i32)),
9 => Ok(ProtobufMainKey::Key(ProtobufNamedKey::F9 as i32)),
10 => Ok(ProtobufMainKey::Key(ProtobufNamedKey::F10 as i32)),
11 => Ok(ProtobufMainKey::Key(ProtobufNamedKey::F11 as i32)),
12 => Ok(ProtobufMainKey::Key(ProtobufNamedKey::F12 as i32)),
_ => Err("Invalid key")... |
rust_dataset_chunk_519465 | rust_dataset.txt | 519,465 | 512 | BareKey::Tab,
ProtobufNamedKey::Esc => BareKey::Esc,
ProtobufNamedKey::CapsLock => BareKey::CapsLock,
ProtobufNamedKey::ScrollLock => BareKey::ScrollLock,
ProtobufNamedKey::PrintScreen => BareKey::PrintScreen,
ProtobufNamedKey::Pause => BareKey::Pause,
ProtobufNamedKey::... |
rust_dataset_chunk_519466 | rust_dataset.txt | 519,466 | 512 | definitions
// statically.
//
// [1]: https://github.com/zellij-org/zellij/pull/2711#issuecomment-1695015818
//pub mod generated_api {
// include!(concat!(env!("OUT_DIR"), "/generated_plugin_api.rs"));
//}
pub mod generated_api {
include!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/assets/pros... |
rust_dataset_chunk_519467 | rust_dataset.txt | 519,467 | 512 | -utils/src/plugin_api/pipe_message.rs ---
pub use super::generated_api::api::pipe_message::{
Arg as ProtobufArg, PipeMessage as ProtobufPipeMessage, PipeSource as ProtobufPipeSource,
};
use crate::data::{PipeMessage, PipeSource};
use std::convert::TryFrom;
pub fn pipe_message_from_protobuf_bytes(bytes: &[u8]) -> ... |
rust_dataset_chunk_519468 | rust_dataset.txt | 519,468 | 512 | impl TryFrom<PipeMessage> for ProtobufPipeMessage {
type Error = &'static str;
fn try_from(pipe_message: PipeMessage) -> Result<Self, &'static str> {
let mut prompt_caller_plugin_id = None;
let mut prompt_request_id = None;
let (source, cli_source_id, plugin_source_id) = match pipe_messa... |
rust_dataset_chunk_519469 | rust_dataset.txt | 519,469 | 512 | read.source, PipeSource::Keybind);
assert_eq!(read.name, "x");
}
#[test]
fn every_pipe_source_survives_protobuf() {
for source in [
PipeSource::Cli("id".to_owned()),
PipeSource::Plugin(3),
PipeSource::Keybind,
PipeSource::PromptRequest {
... |
rust_dataset_chunk_519470 | rust_dataset.txt | 519,470 | 512 | ToTabWithIdResponse as ProtobufBreakPanesToTabWithIdResponse,
BreakPanesToTabWithIndexPayload,
BreakPanesToTabWithIndexResponse as ProtobufBreakPanesToTabWithIndexResponse,
ChangeFloatingPanesCoordinatesPayload, ChangeHostFolderPayload, ClearPaneHighlightsPayload,
ClearScreenForPaneIdPay... |
rust_dataset_chunk_519471 | rust_dataset.txt | 519,471 | 512 | GetPaneInfoPayload,
GetPaneInfoResponse as ProtobufGetPaneInfoResponse, GetPanePidPayload,
GetPanePidResponse as ProtobufGetPanePidResponse,
GetPaneRunningCommandPayload as ProtobufGetPaneRunningCommandPayload,
GetPaneRunningCommandResponse as ProtobufGetPaneRunningCommandResponse,
... |
rust_dataset_chunk_519472 | rust_dataset.txt | 519,472 | 512 | CommandPaneFloatingNearPluginPayload,
OpenCommandPaneFloatingNearPluginResponse as ProtobufOpenCommandPaneFloatingNearPluginResponse,
OpenCommandPaneFloatingResponse as ProtobufOpenCommandPaneFloatingResponse,
OpenCommandPaneInPlaceOfPaneIdPayload,
OpenCommandPaneInPlaceOfPaneIdResponse ... |
rust_dataset_chunk_519473 | rust_dataset.txt | 519,473 | 512 | Response as ProtobufOpenTerminalPaneInPlaceOfPaneIdResponse,
OpenTerminalResponse as ProtobufOpenTerminalResponse, OverrideLayoutPayload,
PageScrollDownInPaneIdPayload, PageScrollUpInPaneIdPayload, PaneId as ProtobufPaneId,
PaneIdAndFloatingPaneCoordinates, PaneType as ProtobufPaneType, ParseLay... |
rust_dataset_chunk_519474 | rust_dataset.txt | 519,474 | 512 | ShowFloatingPanesResponse as ProtobufShowFloatingPanesResponse, ShowPaneWithIdPayload,
ShowSlotPayload, SlotCommandResponse as ProtobufSlotCommandResponse, StackPanesPayload,
SubscribePayload, SwitchSessionPayload, SwitchTabToIdPayload, SwitchTabToPayload,
ThemeEntry as ProtobufThemeEntr... |
rust_dataset_chunk_519475 | rust_dataset.txt | 519,475 | 512 | Some(PercentOrFixed::Percent(x.value as usize))
},
Some(ProtobufFixedOrPercent::Fixed) => {
Some(PercentOrFixed::Fixed(x.value as usize))
},
None => None,
}),
y: self
.y
... |
rust_dataset_chunk_519476 | rust_dataset.txt | 519,476 | 512 | .y {
Some(PercentOrFixed::Percent(percent)) => Some(ProtobufFixedOrPercentValue {
r#type: ProtobufFixedOrPercent::Percent as i32,
value: percent as u32,
}),
Some(PercentOrFixed::Fixed(fixed)) => Some(ProtobufFixedOrPercentValue {
... |
rust_dataset_chunk_519477 | rust_dataset.txt | 519,477 | 512 | }
}
}
impl TryFrom<ProtobufPaneId> for PaneId {
type Error = &'static str;
fn try_from(protobuf_pane_id: ProtobufPaneId) -> Result<Self, &'static str> {
match ProtobufPaneType::try_from(protobuf_pane_id.pane_type).ok() {
Some(ProtobufPaneType::Terminal) => Ok(PaneId::Terminal(protobuf_... |
rust_dataset_chunk_519478 | rust_dataset.txt | 519,478 | 512 | GetPaneRunningCommandResponse::Ok(args) => ProtobufGetPaneRunningCommandResponse {
result: Some(get_pane_running_command_response::Result::Command(
ProtobufRunningCommand { args },
)),
},
GetPaneRunningCommandResponse::Err(err) => P... |
rust_dataset_chunk_519479 | rust_dataset.txt | 519,479 | 512 | illSessionsResponse> for ProtobufKillSessionsResponse {
fn from(response: KillSessionsResponse) -> Self {
match response {
KillSessionsResponse::Ok => ProtobufKillSessionsResponse { error: None },
KillSessionsResponse::Err(err) => ProtobufKillSessionsResponse { error: Some(err) },
... |
rust_dataset_chunk_519480 | rust_dataset.txt | 519,480 | 512 | map(|s| s.to_string())
.unwrap_or_else(|| String::from(""));
ProtobufGetPaneCwdResponse {
result: Some(get_pane_cwd_response::Result::Cwd(cwd_string)),
}
},
GetPaneCwdResponse::Err(err) => ProtobufGetPaneCwdResponse {
... |
rust_dataset_chunk_519481 | rust_dataset.txt | 519,481 | 512 | ) => ProtobufSaveLayoutResponse {
result: Some(save_layout_response::Result::Error(error)),
},
}
}
}
impl TryFrom<ProtobufDeleteLayoutResponse> for DeleteLayoutResponse {
type Error = &'static str;
fn try_from(protobuf_response: ProtobufDeleteLayoutResponse) -> Result<Se... |
rust_dataset_chunk_519482 | rust_dataset.txt | 519,482 | 512 | (())),
Some(edit_layout_response::Result::Error(error)) => Ok(EditLayoutResponse::Err(error)),
None => Err("Empty EditLayoutResponse"),
}
}
}
impl From<EditLayoutResponse> for ProtobufEditLayoutResponse {
fn from(response: EditLayoutResponse) -> Self {
match response {
... |
rust_dataset_chunk_519483 | rust_dataset.txt | 519,483 | 512 | Id), &'static str> {
Ok((
payload.session_name,
payload
.pane_id
.ok_or("Missing pane id in session pane payload")?
.try_into()?,
))
}
fn key_to_rebind_to_plugin_command_assets(
key_to_rebind: KeyToRebind,
) -> Option<(InputMode, KeyWithModifier, Vec<Acti... |
rust_dataset_chunk_519484 | rust_dataset.txt | 519,484 | 512 | match protobuf_plugin_command.payload {
Some(Payload::SetSelectablePayload(should_be_selectable)) => {
Ok(PluginCommand::SetSelectable(should_be_selectable))
},
_ => Err("Mismatched payload for SetSelectable"),
},
Some(CommandN... |
rust_dataset_chunk_519485 | rust_dataset.txt | 519,485 | 512 | _pane_coordinates,
context,
)),
None => Err("Malformed open file payload"),
}
},
_ => Err("Mismatched payload for OpenFileFloating"),
},
Some(CommandName::OpenTerminal)... |
rust_dataset_chunk_519486 | rust_dataset.txt | 519,486 | 512 |
.context
.into_iter()
.map(|e| (e.name, e.value))
.collect();
Ok(PluginCommand::OpenCommandPaneFloating(
command_to_run.try_into()?... |
rust_dataset_chunk_519487 | rust_dataset.txt | 519,487 | 512 | (CommandName::ShowSelf) => match protobuf_plugin_command.payload {
Some(Payload::ShowSelfPayload(should_float_if_hidden)) => {
Ok(PluginCommand::ShowSelf(should_float_if_hidden))
},
_ => Err("Mismatched payload for ShowSelf"),
},
... |
rust_dataset_chunk_519488 | rust_dataset.txt | 519,488 | 512 | Some(CommandName::ToggleFloatingPanes) => match protobuf_plugin_command.payload {
Some(Payload::ToggleFloatingPanesPayload(payload)) => {
Ok(PluginCommand::ToggleFloatingPanes {
tab_id: payload.tab_id,
})
},
... |
rust_dataset_chunk_519489 | rust_dataset.txt | 519,489 | 512 | a payload");
}
Ok(PluginCommand::FocusLastPane)
},
Some(CommandName::MoveFocus) => match protobuf_plugin_command.payload {
Some(Payload::MoveFocusPayload(move_payload)) => match move_payload.direction {
Some(direction) => Ok(Pl... |
rust_dataset_chunk_519490 | rust_dataset.txt | 519,490 | 512 | .try_into()?))
},
None => Err("Malformed MovePaneWithDirection payload"),
}
},
_ => Err("Mismatched payload for MovePaneWithDirection"),
},
Some(CommandName::ClearScreen) => {
if p... |
rust_dataset_chunk_519491 | rust_dataset.txt | 519,491 | 512 | Session)
},
Some(CommandName::TogglePaneFrames) => {
if protobuf_plugin_command.payload.is_some() {
return Err("TogglePaneFrames should not have a payload");
}
Ok(PluginCommand::TogglePaneFrames)
},
Some(... |
rust_dataset_chunk_519492 | rust_dataset.txt | 519,492 | 512 | Some(CommandName::PreviousSwapLayout) => {
if protobuf_plugin_command.payload.is_some() {
return Err("PreviousSwapLayout should not have a payload");
}
Ok(PluginCommand::PreviousSwapLayout)
},
Some(CommandName::NextS... |
rust_dataset_chunk_519493 | rust_dataset.txt | 519,493 | 512 | pane_id as u32))
},
_ => Err("Mismatched payload for CloseTerminalPane"),
},
Some(CommandName::ClosePluginPane) => match protobuf_plugin_command.payload {
Some(Payload::ClosePluginPanePayload(pane_id)) => {
Ok(PluginCommand::Clo... |
rust_dataset_chunk_519494 | rust_dataset.txt | 519,494 | 512 | Ok(PluginCommand::RenameTab(tab_index, name))
},
_ => Err("Mismatched payload for RenameTab"),
},
Some(CommandName::ReportCrash) => match protobuf_plugin_command.payload {
Some(Payload::ReportCrashPayload(payload)) => {
Ok(Plug... |
rust_dataset_chunk_519495 | rust_dataset.txt | 519,495 | 512 | ed payload for OpenTerminalInPlace"),
},
Some(CommandName::OpenFileInPlace) => match protobuf_plugin_command.payload {
Some(Payload::OpenFileInPlacePayload(file_to_open_payload)) => {
match file_to_open_payload.file_to_open {
Some(file_... |
rust_dataset_chunk_519496 | rust_dataset.txt | 519,496 | 512 | )) => {
let context: BTreeMap<String, String> = web_request_payload
.context
.into_iter()
.map(|e| (e.name, e.value))
.collect();
let headers: BTreeMap<String, String> = web_request_pa... |
rust_dataset_chunk_519497 | rust_dataset.txt | 519,497 | 512 | "),
},
Some(CommandName::SetCliPipeExitCode) => match protobuf_plugin_command.payload {
Some(Payload::SetCliPipeExitCodePayload(SetCliPipeExitCodePayload {
pipe_name,
exit_code,
})) => Ok(PluginCommand::SetCliPipeExitCode(pi... |
rust_dataset_chunk_519498 | rust_dataset.txt | 519,498 | 512 | {
Ok(PluginCommand::KillSessions(session_names))
},
_ => Err("Mismatched payload for KillSessions"),
},
Some(CommandName::ScanHostFolder) => match protobuf_plugin_command.payload {
Some(Payload::ScanHostFolderPayload(folder_to_... |
rust_dataset_chunk_519499 | rust_dataset.txt | 519,499 | 512 | tab_index: payload.tab_index.map(|i| i as usize),
})
},
None => Ok(PluginCommand::DumpSessionLayout { tab_index: None }),
_ => Err("Mismatched payload for DumpSessionLayout"),
},
Some(CommandName::CloseSelf) => match protobuf_p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.