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_519300 | rust_dataset.txt | 519,300 | 512 | Err("BreakPane should not have a payload"),
None => Ok(Action::BreakPane),
},
Some(ProtobufActionName::BreakPaneRight) => match protobuf_action.optional_payload {
Some(_) => Err("BreakPaneRight should not have a payload"),
None => Ok(Action::Break... |
rust_dataset_chunk_519301 | rust_dataset.txt | 519,301 | 512 | : false,
no_focus: false,
tab_id: None,
}),
},
Some(ProtobufActionName::NewBlockingPane) => match protobuf_action.optional_payload {
Some(OptionalPayload::NewBlockingPanePayload(payload)) => {
let placeme... |
rust_dataset_chunk_519302 | rust_dataset.txt | 519,302 | 512 | (_) => Err("FocusHostSession should not have a payload"),
None => Ok(Action::FocusHostSession),
},
Some(ProtobufActionName::FocusGuestSession) => match protobuf_action.optional_payload {
Some(_) => Err("FocusGuestSession should not have a payload"),
... |
rust_dataset_chunk_519303 | rust_dataset.txt | 519,303 | 512 | .pane_id
.ok_or("Missing pane id for Action::TogglePanePinnedByPaneId")?
.try_into()?,
})
},
_ => Err("Wrong payload for Action::TogglePanePinnedByPaneId"),
... |
rust_dataset_chunk_519304 | rust_dataset.txt | 519,304 | 512 | direction,
})
},
_ => Err("Wrong payload for Action::MoveTabByTabId"),
},
Some(ProtobufActionName::MoveTabToPosition) => match protobuf_action.optional_payload {
Some(OptionalPayload::MoveTabToPositionPay... |
rust_dataset_chunk_519305 | rust_dataset.txt | 519,305 | 512 | | Action::HalfPageScrollDownByPaneId { .. }
| Action::ResizeByPaneId { .. }
| Action::MovePaneByPaneId { .. }
| Action::MovePaneBackwardsByPaneId { .. }
| Action::ClearScreenByPaneId { .. }
| Action::EditScrollbackByPaneId { .. }
| Action::ToggleF... |
rust_dataset_chunk_519306 | rust_dataset.txt | 519,306 | 512 | Payload {
pane_id: Some(pane_id.try_into()?),
})),
}),
Action::TogglePaneInGroupByPaneId { pane_id } => Ok(ProtobufAction {
name: ProtobufActionName::TogglePaneInGroupByPaneId as i32,
optional_payload: Some(OptionalPayload::Targ... |
rust_dataset_chunk_519307 | rust_dataset.txt | 519,307 | 512 | _mode: input_mode as i32,
},
)),
})
},
Action::SwitchModeForAllClients { input_mode } => {
let input_mode: ProtobufInputMode = input_mode.try_into()?;
Ok(ProtobufAction {
name: Protobu... |
rust_dataset_chunk_519308 | rust_dataset.txt | 519,308 | 512 | : ProtobufResizeDirection = direction.try_into().ok()?;
Some(protobuf_direction as i32)
});
Ok(ProtobufAction {
name: ProtobufActionName::MovePane as i32,
optional_payload: Some(OptionalPayload::MovePanePayload(MovePanePayload {... |
rust_dataset_chunk_519309 | rust_dataset.txt | 519,309 | 512 | ()?;
Ok(ProtobufAction {
name: ProtobufActionName::ScrollUpAt as i32,
optional_payload: Some(OptionalPayload::ScrollUpAtPayload(ScrollAtPayload {
position: Some(position),
})),
})
},
... |
rust_dataset_chunk_519310 | rust_dataset.txt | 519,310 | 512 | Name::ToggleStackListOrientation as i32,
optional_payload: None,
}),
Action::ToggleStackListOrientationByPaneId { pane_id } => Ok(ProtobufAction {
name: ProtobufActionName::ToggleStackListOrientationByPaneId as i32,
optional_payload: Some(OptionalP... |
rust_dataset_chunk_519311 | rust_dataset.txt | 519,311 | 512 | Action {
name: ProtobufActionName::EditFile as i32,
optional_payload: Some(OptionalPayload::EditFilePayload(EditFilePayload {
file_to_edit,
line_number,
should_float,
direction,
... |
rust_dataset_chunk_519312 | rust_dataset.txt | 519,312 | 512 | anes as i32,
optional_payload: None,
}),
Action::ShowFloatingPanes { tab_id } => Ok(ProtobufAction {
name: ProtobufActionName::ShowFloatingPanes as i32,
optional_payload: Some(OptionalPayload::ShowFloatingPanesPayload(
ShowFloat... |
rust_dataset_chunk_519313 | rust_dataset.txt | 519,313 | 512 | _swap_tiled_layouts = swap_tiled_layouts
.as_ref()
.map(|layouts| {
layouts
.iter()
.map(|l| l.clone().try_into())
.collect::<Result<Vec<_>, _>>()
})
... |
rust_dataset_chunk_519314 | rust_dataset.txt | 519,314 | 512 | Name::CloseTab as i32,
optional_payload: None,
}),
Action::GoToTab { index: tab_index } => Ok(ProtobufAction {
name: ProtobufActionName::GoToTab as i32,
optional_payload: Some(OptionalPayload::GoToTabPayload(tab_index)),
}),
... |
rust_dataset_chunk_519315 | rust_dataset.txt | 519,315 | 512 | let run_command_action: ProtobufRunCommandAction = run_command_action.try_into()?;
Ok(ProtobufAction {
name: ProtobufActionName::RunInBackground as i32,
optional_payload: Some(OptionalPayload::RunPayload(run_command_action)),
})
... |
rust_dataset_chunk_519316 | rust_dataset.txt | 519,316 | 512 | ,
optional_payload: None,
}),
Action::GoToNextAttention => Ok(ProtobufAction {
name: ProtobufActionName::GoToNextAttention as i32,
optional_payload: None,
}),
Action::ToggleTrayIcon => Ok(ProtobufAction {
nam... |
rust_dataset_chunk_519317 | rust_dataset.txt | 519,317 | 512 | _into()?),
})),
}),
Action::ToggleBars { bars } => Ok(ProtobufAction {
name: ProtobufActionName::ToggleBars as i32,
optional_payload: Some(OptionalPayload::BarNamesPayload(BarNamesPayload {
bar_names: bars,
})),
... |
rust_dataset_chunk_519318 | rust_dataset.txt | 519,318 | 512 | obufActionName::LaunchOrFocusPlugin as i32,
optional_payload: Some(OptionalPayload::LaunchOrFocusPluginPayload(
LaunchOrFocusPluginPayload {
plugin_url: run_plugin_or_alias.location_string(),
should_float,
... |
rust_dataset_chunk_519319 | rust_dataset.txt | 519,319 | 512 | => Ok(ProtobufAction {
name: ProtobufActionName::ToggleMouseMode as i32,
optional_payload: None,
}),
Action::PreviousSwapLayout => Ok(ProtobufAction {
name: ProtobufActionName::PreviousSwapLayout as i32,
optional_payload: None,
... |
rust_dataset_chunk_519320 | rust_dataset.txt | 519,320 | 512 | ,
..
} => Ok(ProtobufAction {
name: ProtobufActionName::NewFloatingPluginPane as i32,
optional_payload: Some(OptionalPayload::NewFloatingPluginPanePayload(
NewPluginPanePayload {
plugin_url: run_plugin.location_strin... |
rust_dataset_chunk_519321 | rust_dataset.txt | 519,321 | 512 | ProtobufAction {
name: ProtobufActionName::RenameTerminalPane as i32,
optional_payload: Some(OptionalPayload::RenameTerminalPanePayload(IdAndName {
name: new_name,
id: terminal_pane_id,
})),
}),
Action::Renam... |
rust_dataset_chunk_519322 | rust_dataset.txt | 519,322 | 512 | optional_payload: None,
}),
Action::NewStackedPane {
command: _,
pane_name: _,
near_current_pane: _,
..
} => Ok(ProtobufAction {
name: ProtobufActionName::NewStackedPane as i32,
optional_... |
rust_dataset_chunk_519323 | rust_dataset.txt | 519,323 | 512 | ::FocusHostSession => Ok(ProtobufAction {
name: ProtobufActionName::FocusHostSession as i32,
optional_payload: None,
}),
Action::FocusGuestSession => Ok(ProtobufAction {
name: ProtobufActionName::FocusGuestSession as i32,
optional_p... |
rust_dataset_chunk_519324 | rust_dataset.txt | 519,324 | 512 | SearchOption::CaseSensitivity => Ok(ProtobufSearchOption::CaseSensitivity),
SearchOption::WholeWord => Ok(ProtobufSearchOption::WholeWord),
SearchOption::Wrap => Ok(ProtobufSearchOption::Wrap),
}
}
}
impl TryFrom<ProtobufSearchDirection> for SearchDirection {
type Error = &'sta... |
rust_dataset_chunk_519325 | rust_dataset.txt | 519,325 | 512 | _run_command_action
.direction
.and_then(|d| ProtobufResizeDirection::try_from(d).ok())
.and_then(|d| d.try_into().ok());
let hold_on_close = protobuf_run_command_action.hold_on_close;
let hold_on_start = protobuf_run_command_action.hold_on_start;
Ok(RunComman... |
rust_dataset_chunk_519326 | rust_dataset.txt | 519,326 | 512 | 1 => MouseEventType::Release,
_ => MouseEventType::Motion,
},
left: protobuf_event.left as bool,
right: protobuf_event.right as bool,
middle: protobuf_event.middle as bool,
wheel_up: protobuf_event.wheel_up as bool,
wheel_down: prot... |
rust_dataset_chunk_519327 | rust_dataset.txt | 519,327 | 512 | : PluginUserConfiguration) -> Result<Self, &'static str> {
let mut converted = vec![];
for (name, value) in plugin_configuration.inner() {
let name_and_value = ProtobufNameAndValue {
name: name.to_owned(),
value: value.to_owned(),
};
co... |
rust_dataset_chunk_519328 | rust_dataset.txt | 519,328 | 512 | Insert,
Some(ProtobufBareKey::F1) => crate::data::BareKey::F(1),
Some(ProtobufBareKey::F2) => crate::data::BareKey::F(2),
Some(ProtobufBareKey::F3) => crate::data::BareKey::F(3),
Some(ProtobufBareKey::F4) => crate::data::BareKey::F(4),
Some(ProtobufBareKey::F5... |
rust_dataset_chunk_519329 | rust_dataset.txt | 519,329 | 512 | Lock) => crate::data::BareKey::NumLock,
Some(ProtobufBareKey::PrintScreen) => crate::data::BareKey::PrintScreen,
Some(ProtobufBareKey::Pause) => crate::data::BareKey::Pause,
Some(ProtobufBareKey::Menu) => crate::data::BareKey::Menu,
_ => return Err("Unknown BareKey"),
... |
rust_dataset_chunk_519330 | rust_dataset.txt | 519,330 | 512 | i32, None),
crate::data::BareKey::Backspace => (ProtobufBareKey::Backspace as i32, None),
crate::data::BareKey::Delete => (ProtobufBareKey::Delete as i32, None),
crate::data::BareKey::Insert => (ProtobufBareKey::Insert as i32, None),
crate::data::BareKey::F(1) => (Protob... |
rust_dataset_chunk_519331 | rust_dataset.txt | 519,331 | 512 | ::data::BareKey::Enter => (ProtobufBareKey::Enter as i32, None),
crate::data::BareKey::CapsLock => (ProtobufBareKey::CapsLock as i32, None),
crate::data::BareKey::ScrollLock => (ProtobufBareKey::ScrollLock as i32, None),
crate::data::BareKey::NumLock => (ProtobufBareKey::NumLock as i... |
rust_dataset_chunk_519332 | rust_dataset.txt | 519,332 | 512 | ::OnExitSuccess => Ok(ProtobufUnblockCondition::UnblockOnExitSuccess),
UnblockCondition::OnExitFailure => Ok(ProtobufUnblockCondition::UnblockOnExitFailure),
UnblockCondition::OnAnyExit => Ok(ProtobufUnblockCondition::UnblockOnAnyExit),
}
}
}
impl TryFrom<i32> for UnblockCondition {... |
rust_dataset_chunk_519333 | rust_dataset.txt | 519,333 | 512 | Size::Fixed(f as usize)),
None => Err("SplitSize must have either percent or fixed value"),
}
}
}
impl TryFrom<SplitSize> for ProtobufSplitSize {
type Error = &'static str;
fn try_from(split_size: SplitSize) -> Result<Self, &'static str> {
use super::generated_api::api::action::... |
rust_dataset_chunk_519334 | rust_dataset.txt | 519,334 | 512 | ()),
width: protobuf_coords.width.and_then(|w| w.try_into().ok()),
height: protobuf_coords.height.and_then(|h| h.try_into().ok()),
pinned: protobuf_coords.pinned,
borderless: protobuf_coords.borderless,
border_style: protobuf_coords.border_style.map(BorderStyl... |
rust_dataset_chunk_519335 | rust_dataset.txt | 519,335 | 512 | Ok(NewPanePlacement::InPlace {
pane_id_to_replace,
close_replaced_pane: config.close_replaced_pane,
borderless: config.borderless,
border_style: config.border_style.map(BorderStyleOverride::from),
})
... |
rust_dataset_chunk_519336 | rust_dataset.txt | 519,336 | 512 | placed_pane,
borderless,
border_style: border_style.map(|b| b.into()),
}))
},
NewPanePlacement::Stacked {
pane_id_to_stack_under,
borderless,
border_style,
} => {
l... |
rust_dataset_chunk_519337 | rust_dataset.txt | 519,337 | 512 | Direction) -> Result<Self, Self::Error> {
Ok(match internal {
SplitDirection::Horizontal => ProtobufSplitDirection::Horizontal,
SplitDirection::Vertical => ProtobufSplitDirection::Vertical,
})
}
}
impl TryFrom<ProtobufLayoutConstraint> for LayoutConstraint {
type Error =... |
rust_dataset_chunk_519338 | rust_dataset.txt | 519,338 | 512 | = &'static str;
fn try_from(internal: LayoutConstraint) -> Result<Self, Self::Error> {
let (constraint_type, value) = match internal {
LayoutConstraint::MaxPanes(v) => {
(ProtobufLayoutConstraint::MaxPanes as i32, Some(v as u32))
},
LayoutConstraint::MinP... |
rust_dataset_chunk_519339 | rust_dataset.txt | 519,339 | 512 | (LocationData::FilePath(path)) => Ok(RunPluginLocation::File(PathBuf::from(path))),
Some(LocationData::ZellijTag(tag)) => Ok(RunPluginLocation::Zellij(tag.try_into()?)),
Some(LocationData::RemoteUrl(url)) => Ok(RunPluginLocation::Remote(url)),
None => Err("RunPluginLocationData must ... |
rust_dataset_chunk_519340 | rust_dataset.txt | 519,340 | 512 | _host_cmd,
location: Some(internal.location.try_into()?),
configuration: Some(internal.configuration.try_into()?),
initial_cwd: internal.initial_cwd.map(|p| p.display().to_string()),
})
}
}
impl TryFrom<ProtobufPluginAlias> for PluginAlias {
type Error = &'static str... |
rust_dataset_chunk_519341 | rust_dataset.txt | 519,341 | 512 | RunPluginOrAlias::Alias(alias) => Some(PluginType::Alias(alias.try_into()?)),
};
Ok(ProtobufRunPluginOrAlias { plugin_type })
}
}
impl TryFrom<ProtobufRunEditFileAction> for Run {
type Error = &'static str;
fn try_from(protobuf: ProtobufRunEditFileAction) -> Result<Self, Self::E... |
rust_dataset_chunk_519342 | rust_dataset.txt | 519,342 | 512 | n| n as u32),
cwd: cwd.map(|p| p.display().to_string()),
}))
},
Run::Cwd(cwd) => Some(RunType::Cwd(cwd.display().to_string())),
};
Ok(ProtobufPaneRun { run_type })
}
}
impl TryFrom<ProtobufCommandOrPlugin> for CommandOrPlugin {
type Er... |
rust_dataset_chunk_519343 | rust_dataset.txt | 519,343 | 512 | TryFrom<ProtobufTabLayoutInfo> for TabLayoutInfo {
type Error = &'static str;
fn try_from(protobuf_tab: ProtobufTabLayoutInfo) -> Result<Self, Self::Error> {
Ok(TabLayoutInfo {
tab_index: protobuf_tab.tab_index as usize,
tab_name: protobuf_tab.tab_name.filter(|s| !s.is_empty())... |
rust_dataset_chunk_519344 | rust_dataset.txt | 519,344 | 512 | .collect::<Result<Vec<_>, _>>()?,
})
}
}
impl TryFrom<ProtobufTiledPaneLayout> for TiledPaneLayout {
type Error = &'static str;
fn try_from(protobuf: ProtobufTiledPaneLayout) -> Result<Self, Self::Error> {
let children_split_direction =
ProtobufSplitDirection::tr... |
rust_dataset_chunk_519345 | rust_dataset.txt | 519,345 | 512 | into_iter()
.map(|c| c.try_into())
.collect::<Result<Vec<_>, _>>()?;
let split_size = internal.split_size.map(|s| s.try_into()).transpose()?;
let run = internal.run.map(|r| r.try_into()).transpose()?;
let focus = internal.focus.map(|f| f.to_string());
Ok(ProtobufT... |
rust_dataset_chunk_519346 | rust_dataset.txt | 519,346 | 512 | ;
fn try_from(internal: FloatingPaneLayout) -> Result<Self, Self::Error> {
let height = internal.height.map(|h| h.try_into()).transpose()?;
let width = internal.width.map(|w| w.try_into()).transpose()?;
let x = internal.x.map(|x| x.try_into()).transpose()?;
let y = internal.y.map(|y|... |
rust_dataset_chunk_519347 | rust_dataset.txt | 519,347 | 512 | | l.try_into())
.collect::<Result<Vec<_>, _>>()?;
Ok((constraint, layouts))
}
}
impl TryFrom<(LayoutConstraint, Vec<FloatingPaneLayout>)> for ProtobufLayoutConstraintFloatingPair {
type Error = &'static str;
fn try_from(
internal: (LayoutConstraint, Vec<FloatingPaneLayout>),
... |
rust_dataset_chunk_519348 | rust_dataset.txt | 519,348 | 512 | : SwapFloatingLayout) -> Result<Self, Self::Error> {
let constraint_map = internal
.0
.into_iter()
.map(|(constraint, layouts)| (constraint, layouts).try_into())
.collect::<Result<Vec<_>, _>>()?;
Ok(ProtobufSwapFloatingLayout {
constraint_map,
... |
rust_dataset_chunk_519349 | rust_dataset.txt | 519,349 | 512 | assert_eq!(original, decoded);
}
#[test]
fn bar_actions_round_trip_over_protobuf() {
for original in [
Action::ToggleBars { bars: vec![] },
Action::ToggleBars {
bars: vec!["status-bar".to_owned(), "tab-bar".to_owned()],
},
Action::Hid... |
rust_dataset_chunk_519350 | rust_dataset.txt | 519,350 | 512 | fn by_id_actions_without_a_target_are_rejected_over_protobuf() {
let pane_actions = [
ProtobufActionName::CloseFocusByPaneId,
ProtobufActionName::ToggleFocusFullscreenByPaneId,
ProtobufActionName::TogglePaneEmbedOrFloatingByPaneId,
ProtobufActionName::TogglePaneP... |
rust_dataset_chunk_519351 | rust_dataset.txt | 519,351 | 512 | {
use super::super::generated_api::api::action::NewPanePlacement as ProtobufNewPanePlacement;
use crate::data::LineStyle;
for original in [
NewPanePlacement::NoPreference {
borderless: None,
border_style: Some(BorderStyleOverride {
... |
rust_dataset_chunk_519352 | rust_dataset.txt | 519,352 | 512 | _into().expect("decode");
assert_eq!(decoded.border_style, border_style);
let floating = FloatingPaneLayout {
border_style,
..Default::default()
};
let protobuf: ProtobufFloatingPaneLayout = floating.clone().try_into().expect("encode");
let decoded: Float... |
rust_dataset_chunk_519353 | rust_dataset.txt | 519,353 | 512 | _arrival::Arrival as ProtobufArrival, AttentionArrival as ProtobufAttentionArrival,
BackArrival as ProtobufBackArrival, ForwardArrival as ProtobufForwardArrival,
SessionArrival as ProtobufSessionArrival, SwitchArrival as ProtobufSwitchArrival,
ToggleArrival as ProtobufToggleArrival,
};
use super::generated_... |
rust_dataset_chunk_519354 | rust_dataset.txt | 519,354 | 512 | _str().to_owned()),
progress: detail.progress.map(|p| p as u32),
app: detail.app,
title: detail.title,
body: detail.body,
exit_code: detail.exit_code,
duration_ms: detail.duration_ms,
command: detail.command.map(|c| c.into()),
}... |
rust_dataset_chunk_519355 | rust_dataset.txt | 519,355 | 512 | : attention.ignore_output,
watched: attention.watched,
from_watch: attention.from_watch,
remembered: attention.remembered.map(|r| RememberedStatus {
status: AttentionStatus::from_str(&r.status).unwrap_or_default(),
text: r.text,
since_m... |
rust_dataset_chunk_519356 | rust_dataset.txt | 519,356 | 512 | is_local: cwd.is_local,
}
}
}
impl From<CommandState> for ProtobufCommandState {
fn from(state: CommandState) -> Self {
ProtobufCommandState {
phase: state.phase.as_str().to_owned(),
running: state.running.map(|r| r.into()),
last: state.last.map(|l| l.into()... |
rust_dataset_chunk_519357 | rust_dataset.txt | 519,357 | 512 | as u32,
new_output: counts.new_output as u32,
muted: counts.muted as u32,
}
}
}
impl From<ProtobufAttentionCounts> for AttentionCounts {
fn from(counts: ProtobufAttentionCounts) -> Self {
AttentionCounts {
needs_you: counts.needs_you as usize,
fa... |
rust_dataset_chunk_519358 | rust_dataset.txt | 519,358 | 512 | a.into()).unwrap_or_default(),
})
}
}
impl TryFrom<SessionAttention> for ProtobufSessionAttention {
type Error = &'static str;
fn try_from(attention: SessionAttention) -> Result<Self, &'static str> {
Ok(ProtobufSessionAttention {
status: attention.status.as_str().to_owned(),
... |
rust_dataset_chunk_519359 | rust_dataset.txt | 519,359 | 512 | Attention {
type Error = &'static str;
fn try_from(payload: GlobalAttentionUpdatePayload) -> Result<Self, &'static str> {
let sessions = payload
.sessions
.into_iter()
.map(|s| {
Ok((
s.name,
s.attention
... |
rust_dataset_chunk_519360 | rust_dataset.txt | 519,360 | 512 | ProtobufArrival::Back(_) => SessionArrival::Back,
ProtobufArrival::Forward(_) => SessionArrival::Forward,
ProtobufArrival::Attention(attention) => SessionArrival::Attention {
pane_id: attention
.pane_id
.... |
rust_dataset_chunk_519361 | rust_dataset.txt | 519,361 | 512 | );
let payload: GlobalAttentionUpdatePayload = global.clone().try_into().unwrap();
assert_eq!(GlobalAttention::try_from(payload).unwrap(), global);
let info = SessionHistoryInfo {
current: "here".to_owned(),
previous: Some("api".to_owned()),
back: vec!... |
rust_dataset_chunk_519362 | rust_dataset.txt | 519,362 | 512 | _ms: 5,
}),
last: Some(CommandOutcome {
result: CommandResult::Failed,
exit_code: Some(2),
err: Some("x".to_owned()),
duration_ms: Some(3),
ended_ms: 4,
command: None,
}),
cwd:... |
rust_dataset_chunk_519363 | rust_dataset.txt | 519,363 | 512 | ::from(c));
let border_style = protobuf_command.border_style.map(BorderStyleOverride::from);
Ok(CommandToRun {
path,
args,
cwd,
border_style,
})
}
}
impl TryFrom<CommandToRun> for ProtobufCommand {
type Error = &'static str;
fn try_fro... |
rust_dataset_chunk_519364 | rust_dataset.txt | 519,364 | 512 | dlError as ProtobufKdlError,
KdlErrorVariant as ProtobufKdlErrorVariant, KeyBind as ProtobufKeyBind,
KeybindPresetExample as ProtobufKeybindPresetExample,
KeybindPresetInfo as ProtobufKeybindPresetInfo,
KeybindPresetSource as ProtobufKeybindPresetSource,
KeybindPresetWithError as... |
rust_dataset_chunk_519365 | rust_dataset.txt | 519,365 | 512 | Payload as ProtobufWebServerStatusPayload, WebSharing as ProtobufWebSharing,
*,
},
input_mode::InputMode as ProtobufInputMode,
key::Key as ProtobufKey,
style::{
Style as ProtobufStyle, StyledText as ProtobufStyledText,
StyledTextIndices as ProtobufStyledTextIndices,
},
};
#[a... |
rust_dataset_chunk_519366 | rust_dataset.txt | 519,366 | 512 | has no protobuf representation is dropped rather than failing the whole
/// table: an unrepresentable action costs only that action, an unrepresentable key only
/// that binding, and an unrepresentable mode only that mode. The reader
/// ([`keybinds_from_protobuf`]) drops on the same terms, so a table survives the tri... |
rust_dataset_chunk_519367 | rust_dataset.txt | 519,367 | 512 | _protobuf(keybinds);
}
Ok(protobuf_event)
}
/// Converts a keybinding table back out of its protobuf form.
///
/// Anything that cannot be understood is dropped rather than failing the whole table: a
/// mode, key, or action a given build does not know about simply does not appear. This
/// keeps a table reada... |
rust_dataset_chunk_519368 | rust_dataset.txt | 519,368 | 512 | != ProtobufEventType::InitialKeybinds as i32 {
return None;
}
let payload = parts.initial_keybinds_payload?;
let modes = match InitialKeybindsPayloadParts::decode(payload.as_slice()) {
Ok(payload) => payload.keybinds,
Err(_) => return Some(Err("Malformed payload for InitialKeybinds ... |
rust_dataset_chunk_519369 | rust_dataset.txt | 519,369 | 512 | EventType::TabUpdate) => match protobuf_event.payload {
Some(ProtobufEventPayload::TabUpdatePayload(protobuf_tab_info_payload)) => {
let mut tab_infos: Vec<TabInfo> = vec![];
for protobuf_tab_info in protobuf_tab_info_payload.tab_info {
tab... |
rust_dataset_chunk_519370 | rust_dataset.txt | 519,370 | 512 | let protobuf_copy_to_clipboard =
ProtobufCopyDestination::try_from(copy_to_clipboard)
.ok()
.ok_or("Malformed copy to clipboard payload")?;
Ok(Event::CopyToClipboard(
protobuf_copy_to_clipboard.t... |
rust_dataset_chunk_519371 | rust_dataset.txt | 519,371 | 512 | Some(ProtobufEventType::FileSystemUpdate) => match protobuf_event.payload {
Some(ProtobufEventPayload::FileListPayload(file_list_payload)) => {
let file_paths = file_list_payload
.paths
.iter()
.zip(file_list_pa... |
rust_dataset_chunk_519372 | rust_dataset.txt | 519,372 | 512 | ResultPayload(run_command_result_payload)) => {
Ok(Event::RunCommandResult(
run_command_result_payload.exit_code,
run_command_result_payload.stdout,
run_command_result_payload.stderr,
run_command_result_p... |
rust_dataset_chunk_519373 | rust_dataset.txt | 519,373 | 512 | (pane_closed_payload)) => {
let pane_id = pane_closed_payload
.pane_id
.ok_or("Malformed payload for the PaneClosed Event")?;
Ok(Event::PaneClosed(PaneId::try_from(pane_id)?))
},
_ => Err("Malformed p... |
rust_dataset_chunk_519374 | rust_dataset.txt | 519,374 | 512 | Malformed payload for the FailedToWriteConfigToDisk Event"),
},
Some(ProtobufEventType::ListClients) => match protobuf_event.payload {
Some(ProtobufEventPayload::ListClientsPayload(mut list_clients_payload)) => {
Ok(Event::ListClients(
... |
rust_dataset_chunk_519375 | rust_dataset.txt | 519,375 | 512 | ::SessionCountsUpdate) => match protobuf_event.payload {
Some(ProtobufEventPayload::SessionCountsUpdatePayload(payload)) => {
Ok(Event::SessionCountsUpdate(payload.into()))
},
_ => Err("Malformed payload for the SessionCountsUpdate Event"),
... |
rust_dataset_chunk_519376 | rust_dataset.txt | 519,376 | 512 | WebServerPayload(
failed_to_start_web_server_payload,
)) => Ok(Event::FailedToStartWebServer(
failed_to_start_web_server_payload.error,
)),
_ => Err("Malformed payload for the FailedToStartWebServer Event"),
},
... |
rust_dataset_chunk_519377 | rust_dataset.txt | 519,377 | 512 | item| (item.name, item.value))
.collect();
Ok(Event::ActionComplete(action, pane_id, context))
},
_ => Err("Malformed payload for the ActionComplete Event"),
},
Some(ProtobufEventType::GlobalAttentionUpdate) => match pro... |
rust_dataset_chunk_519378 | rust_dataset.txt | 519,378 | 512 | _ => Err("Malformed payload for the LiveViewStateChanged Event"),
},
Some(ProtobufEventType::PaneAttentionChanged) => match protobuf_event.payload {
Some(ProtobufEventPayload::PaneAttentionChangedPayload(payload)) => {
let pane_id: PaneId = payload
... |
rust_dataset_chunk_519379 | rust_dataset.txt | 519,379 | 512 | Malformed payload for the CommandFinished Event"),
},
Some(ProtobufEventType::CwdChanged) => match protobuf_event.payload {
Some(ProtobufEventPayload::CwdChangedPayload(protobuf_payload)) => {
let pane_id: PaneId = protobuf_payload
.pan... |
rust_dataset_chunk_519380 | rust_dataset.txt | 519,380 | 512 | ::AvailableLayoutInfo(
available_layouts,
layouts_with_errors,
))
},
_ => Err("Malformed payload for the AvailableLayoutInfo Event"),
},
Some(ProtobufEventType::PluginConfigurationChanged) => matc... |
rust_dataset_chunk_519381 | rust_dataset.txt | 519,381 | 512 | Some(ProtobufEventPayload::ContextMenuPayload(payload)) => {
let kind = match ProtobufContextMenuKind::try_from(payload.kind) {
Ok(ProtobufContextMenuKind::Pane) => ContextMenuKind::Pane,
Ok(ProtobufContextMenuKind::PaneFrame) => Contex... |
rust_dataset_chunk_519382 | rust_dataset.txt | 519,382 | 512 | _event.payload {
Some(ProtobufEventPayload::ConfigChangesDroppedPayload(payload)) => {
Ok(Event::ConfigChangesDropped(
payload
.keys
.iter()
.filter_map(|key| SettingKey::from_... |
rust_dataset_chunk_519383 | rust_dataset.txt | 519,383 | 512 | Event"),
}
},
Some(ProtobufEventType::HintText) => match protobuf_event.payload {
Some(ProtobufEventPayload::HintTextPayload(p)) => {
let mut hint_text = BTreeMap::new();
for (width, styled_text) in p.hint_text {
... |
rust_dataset_chunk_519384 | rust_dataset.txt | 519,384 | 512 | ,
payload: Some(event::Payload::ModeUpdatePayload(
protobuf_mode_update_payload,
)),
})
},
Event::TabUpdate(tab_infos) => {
let mut protobuf_tab_infos = vec![];
for tab_info in tab_inf... |
rust_dataset_chunk_519385 | rust_dataset.txt | 519,385 | 512 | ::Timer as i32,
payload: Some(event::Payload::TimerPayload(seconds as f32)),
}),
Event::CopyToClipboard(clipboard_destination) => {
let protobuf_copy_destination: ProtobufCopyDestination =
clipboard_destination.try_into()?;
Ok(P... |
rust_dataset_chunk_519386 | rust_dataset.txt | 519,386 | 512 | vec![];
let mut paths_metadata = vec![];
for (path, path_metadata) in event_paths {
paths.push(path.display().to_string());
paths_metadata.push(path_metadata.into());
}
let file_list_payload = FileListPayload {
... |
rust_dataset_chunk_519387 | rust_dataset.txt | 519,387 | 512 | name, value)| ContextItem { name, value })
.collect(),
};
Ok(ProtobufEvent {
name: ProtobufEventType::RunCommandResult as i32,
payload: Some(event::Payload::RunCommandResultPayload(
run_command_result... |
rust_dataset_chunk_519388 | rust_dataset.txt | 519,388 | 512 | (terminal_pane_id, context) => {
let command_pane_opened_payload = EditPaneOpenedPayload {
terminal_pane_id,
context: context
.into_iter()
.map(|(name, value)| ContextItem { name, value })
.co... |
rust_dataset_chunk_519389 | rust_dataset.txt | 519,389 | 512 | _folder_path) => Ok(ProtobufEvent {
name: ProtobufEventType::HostFolderChanged as i32,
payload: Some(event::Payload::HostFolderChangedPayload(
HostFolderChangedPayload {
new_host_folder_path: new_host_folder_path.display().to_string(),
... |
rust_dataset_chunk_519390 | rust_dataset.txt | 519,390 | 512 | SessionPreview as i32,
payload: Some(event::Payload::SavedSessionPreviewPayload(preview.into())),
}),
Event::PromptResult(request_id, result) => Ok(ProtobufEvent {
name: ProtobufEventType::PromptResult as i32,
payload: Some(event::Payload::PromptRe... |
rust_dataset_chunk_519391 | rust_dataset.txt | 519,391 | 512 | action.try_into()?;
let protobuf_pane_id = pane_id.map(|id| id.try_into()).transpose()?;
let context_items: Vec<ProtobufContextItem> = context
.into_iter()
.map(|(name, value)| ProtobufContextItem { name, value })
.collect();
... |
rust_dataset_chunk_519392 | rust_dataset.txt | 519,392 | 512 |
.map(|release| live_view_release_to_protobuf(release) as i32),
resize_allowed,
view_only,
pinned,
source_size: source_size.map(|size| ProtobufLiveViewSize {
cols: size... |
rust_dataset_chunk_519393 | rust_dataset.txt | 519,393 | 512 | .to_str()
.ok_or("Failed to convert PathBuf to string")?
.to_string();
let focused_client_ids_u32: Vec<u32> =
focused_client_ids.into_iter().map(|id| id as u32).collect();
let cwd_changed_payload = ProtobufCwdChangedPayload {
... |
rust_dataset_chunk_519394 | rust_dataset.txt | 519,394 | 512 | ();
let payload = ProtobufPluginConfigurationChangedPayload {
configuration: configuration_items,
};
Ok(ProtobufEvent {
name: ProtobufEventType::PluginConfigurationChanged as i32,
payload: Some(event::Payload::... |
rust_dataset_chunk_519395 | rust_dataset.txt | 519,395 | 512 | : None,
length: None,
},
};
Ok(ProtobufEvent {
name: ProtobufEventType::ActivePaneScroll as i32,
payload: Some(event::Payload::ActivePaneScrollPayload(payload)),
})
},
... |
rust_dataset_chunk_519396 | rust_dataset.txt | 519,396 | 512 | obufContextMenuEntry {
is_separator: true,
label: String::new(),
actions: vec![],
toggled_label: None,
});
},
Contex... |
rust_dataset_chunk_519397 | rust_dataset.txt | 519,397 | 512 | Some(event::Payload::InitialKeybindsPayload(
InitialKeybindsPayload {
keybinds: protobuf_keybinds,
},
)),
})
},
}
}
}
impl TryFrom<SessionInfo> for ProtobufSessionManifest {
type... |
rust_dataset_chunk_519398 | rust_dataset.txt | 519,398 | 512 | _id as u32,
tab_history: tab_history.into_iter().map(|t| t as u32).collect(),
}
}
}
impl From<(ClientId, Vec<PaneId>)> for ProtobufClientPaneHistory {
fn from((client_id, pane_history): (ClientId, Vec<PaneId>)) -> ProtobufClientPaneHistory {
ProtobufClientPaneHistory {
c... |
rust_dataset_chunk_519399 | rust_dataset.txt | 519,399 | 512 | in protobuf_session_manifest.tab_history.into_iter() {
let client_id = client_tab_history.client_id;
let tab_history_for_client = client_tab_history
.tab_history
.iter()
.map(|t| *t as usize)
.collect();
tab_history.ins... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.