pub enum PerShellString {
All(String),
ByShell {
default: Option<String>,
bash: Option<String>,
zsh: Option<String>,
pwsh: Option<String>,
nu: Option<String>,
},
}Expand description
Expansion string that can be uniform across all shells or per-shell.
expand = "lsd" # All — same for every shell
expand = { default = "7z", pwsh = "7z.exe" } # ByShell — per-shell overrideVariants§
Implementations§
Source§impl PerShellString
impl PerShellString
Sourcepub fn for_shell(&self, shell: Shell) -> Option<&str>
pub fn for_shell(&self, shell: Shell) -> Option<&str>
Return the expansion string for shell, or None if no entry applies.
For ByShell, the shell-specific field takes priority over default.
Shell::Clink always uses default (no clink-specific field).
Returns None when neither the shell-specific field nor default is set.
Sourcepub fn all_values(&self) -> Vec<&str>
pub fn all_values(&self) -> Vec<&str>
Iterate over all non-None string values (used for validation).
Trait Implementations§
Source§impl Clone for PerShellString
impl Clone for PerShellString
Source§fn clone(&self) -> PerShellString
fn clone(&self) -> PerShellString
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PerShellString
impl Debug for PerShellString
Source§impl<'de> Deserialize<'de> for PerShellString
impl<'de> Deserialize<'de> for PerShellString
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for PerShellString
impl PartialEq for PerShellString
Source§impl Serialize for PerShellString
impl Serialize for PerShellString
impl StructuralPartialEq for PerShellString
Auto Trait Implementations§
impl Freeze for PerShellString
impl RefUnwindSafe for PerShellString
impl Send for PerShellString
impl Sync for PerShellString
impl Unpin for PerShellString
impl UnsafeUnpin for PerShellString
impl UnwindSafe for PerShellString
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more