pub struct ShimConfig {
pub shim: ShimCore,
pub args: ArgsConfig,
pub env: HashMap<String, String>,
pub metadata: ShimMetadata,
pub auto_update: Option<AutoUpdate>,
}Expand description
Main shim configuration structure
Fields§
§shim: ShimCoreCore shim configuration
args: ArgsConfigAdvanced argument configuration
env: HashMap<String, String>Environment variables to set
metadata: ShimMetadataOptional metadata
auto_update: Option<AutoUpdate>Auto-update configuration
Implementations§
Source§impl ShimConfig
impl ShimConfig
Sourcepub fn from_file<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn from_file<P: AsRef<Path>>(path: P) -> Result<Self>
Load shim configuration from a TOML file
Sourcepub async fn from_file_async<P: AsRef<Path>>(path: P) -> Result<Self>
pub async fn from_file_async<P: AsRef<Path>>(path: P) -> Result<Self>
Load shim configuration from a TOML file asynchronously
Sourcepub fn to_file<P: AsRef<Path>>(&self, path: P) -> Result<()>
pub fn to_file<P: AsRef<Path>>(&self, path: P) -> Result<()>
Save shim configuration to a TOML file
Sourcepub async fn to_file_async<P: AsRef<Path>>(&self, path: P) -> Result<()>
pub async fn to_file_async<P: AsRef<Path>>(&self, path: P) -> Result<()>
Save shim configuration to a TOML file asynchronously
Sourcepub async fn from_files_concurrent<P: AsRef<Path>>(
paths: Vec<P>,
) -> Vec<Result<Self>> ⓘ
pub async fn from_files_concurrent<P: AsRef<Path>>( paths: Vec<P>, ) -> Vec<Result<Self>> ⓘ
Load multiple configuration files concurrently
Sourcepub async fn to_files_concurrent<P: AsRef<Path>>(
configs_and_paths: Vec<(&Self, P)>,
) -> Vec<Result<()>> ⓘ
pub async fn to_files_concurrent<P: AsRef<Path>>( configs_and_paths: Vec<(&Self, P)>, ) -> Vec<Result<()>> ⓘ
Save multiple configurations concurrently
Sourcepub fn expand_env_vars(&mut self) -> Result<()>
pub fn expand_env_vars(&mut self) -> Result<()>
Expand environment variables in the configuration
Sourcepub fn get_executable_path(&self) -> Result<PathBuf>
pub fn get_executable_path(&self) -> Result<PathBuf>
Get the resolved executable path
Sourcepub fn get_download_url(&self) -> Option<&String>
pub fn get_download_url(&self) -> Option<&String>
Get the download URL for this shim (if it was created from HTTP)
Trait Implementations§
Source§impl Clone for ShimConfig
impl Clone for ShimConfig
Source§fn clone(&self) -> ShimConfig
fn clone(&self) -> ShimConfig
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 ShimConfig
impl Debug for ShimConfig
Source§impl<'de> Deserialize<'de> for ShimConfig
impl<'de> Deserialize<'de> for ShimConfig
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
Auto Trait Implementations§
impl Freeze for ShimConfig
impl RefUnwindSafe for ShimConfig
impl Send for ShimConfig
impl Sync for ShimConfig
impl Unpin for ShimConfig
impl UnwindSafe for ShimConfig
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