aboutsummaryrefslogtreecommitdiffstats
path: root/crates/turtle/src/atuin_client/plugin.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/turtle/src/atuin_client/plugin.rs')
-rw-r--r--crates/turtle/src/atuin_client/plugin.rs26
1 files changed, 13 insertions, 13 deletions
diff --git a/crates/turtle/src/atuin_client/plugin.rs b/crates/turtle/src/atuin_client/plugin.rs
index 6f351bf1..e97b1dbf 100644
--- a/crates/turtle/src/atuin_client/plugin.rs
+++ b/crates/turtle/src/atuin_client/plugin.rs
@@ -1,14 +1,14 @@
use std::collections::HashMap;
#[derive(Debug, Clone)]
-pub struct OfficialPlugin {
- pub name: String,
- pub description: String,
- pub install_message: String,
+pub(crate) struct OfficialPlugin {
+ pub(crate) name: String,
+ pub(crate) description: String,
+ pub(crate) install_message: String,
}
impl OfficialPlugin {
- pub fn new(name: &str, description: &str, install_message: &str) -> Self {
+ pub(crate) fn new(name: &str, description: &str, install_message: &str) -> Self {
Self {
name: name.to_string(),
description: description.to_string(),
@@ -17,12 +17,12 @@ impl OfficialPlugin {
}
}
-pub struct OfficialPluginRegistry {
+pub(crate) struct OfficialPluginRegistry {
plugins: HashMap<String, OfficialPlugin>,
}
impl OfficialPluginRegistry {
- pub fn new() -> Self {
+ pub(crate) fn new() -> Self {
let mut registry = Self {
plugins: HashMap::new(),
};
@@ -47,15 +47,15 @@ impl OfficialPluginRegistry {
);
}
- pub fn get_plugin(&self, name: &str) -> Option<&OfficialPlugin> {
+ pub(crate) fn get_plugin(&self, name: &str) -> Option<&OfficialPlugin> {
self.plugins.get(name)
}
- pub fn is_official_plugin(&self, name: &str) -> bool {
+ pub(crate) fn is_official_plugin(&self, name: &str) -> bool {
self.plugins.contains_key(name)
}
- pub fn get_install_message(&self, name: &str) -> Option<&str> {
+ pub(crate) fn get_install_message(&self, name: &str) -> Option<&str> {
self.plugins
.get(name)
.map(|plugin| plugin.install_message.as_str())
@@ -68,13 +68,13 @@ impl Default for OfficialPluginRegistry {
}
}
-pub struct PluginContext {
+pub(crate) struct PluginContext {
#[cfg(windows)]
_update_on_windows: Option<UpdateOnWindowsContext>,
}
impl PluginContext {
- pub fn new(_subcommand: &str) -> Self {
+ pub(crate) fn new(_subcommand: &str) -> Self {
PluginContext {
#[cfg(windows)]
_update_on_windows: (_subcommand == "update").then(UpdateOnWindowsContext::new),
@@ -95,7 +95,7 @@ struct UpdateOnWindowsContext {
impl UpdateOnWindowsContext {
const OLD_FILE_NAME: &'static str = "atuin.old";
- pub fn new() -> Self {
+ pub(crate) fn new() -> Self {
// Windows doesn't let you overwrite a running exe, but it lets you rename it,
// so make some room for atuin-update to install the new version.
let initial_exe = std::env::current_exe().ok().and_then(|exe| {