Struct proto_pdk::ShimConfig
source · pub struct ShimConfig {
pub bin_path: Option<PathBuf>,
pub parent_bin: Option<String>,
pub before_args: Option<String>,
pub after_args: Option<String>,
}Expand description
Configuration for individual shim files.
Fields§
§bin_path: Option<PathBuf>Relative path from the tool directory to the binary to execute.
parent_bin: Option<String>Name of a parent binary that’s required for this shim to work.
For example, npm requires node.
before_args: Option<String>Custom args to prepend to user-provided args.
after_args: Option<String>Custom args to append to user-provided args.
Implementations§
source§impl ShimConfig
impl ShimConfig
sourcepub fn global_with_alt_bin<B>(bin_path: B) -> ShimConfigwhere
B: AsRef<OsStr>,
pub fn global_with_alt_bin<B>(bin_path: B) -> ShimConfigwhere B: AsRef<OsStr>,
Create a global shim that executes the parent tool, but uses the provided binary as the entry point.
sourcepub fn global_with_sub_command<A>(args: A) -> ShimConfigwhere
A: AsRef<str>,
pub fn global_with_sub_command<A>(args: A) -> ShimConfigwhere A: AsRef<str>,
Create a global shim that executes the parent tool, but prefixes the user-provided arguments with the provided arguments (typically a sub-command).
sourcepub fn local<B>(bin_path: B) -> ShimConfigwhere
B: AsRef<OsStr>,
pub fn local<B>(bin_path: B) -> ShimConfigwhere B: AsRef<OsStr>,
Create a local shim that executes the provided binary.
sourcepub fn local_with_parent<B, P>(bin_path: B, parent: P) -> ShimConfigwhere
B: AsRef<OsStr>,
P: AsRef<str>,
pub fn local_with_parent<B, P>(bin_path: B, parent: P) -> ShimConfigwhere B: AsRef<OsStr>, P: AsRef<str>,
Create a local shim that executes the provided binary through the context of the configured parent.
Trait Implementations§
source§impl Clone for ShimConfig
impl Clone for ShimConfig
source§fn clone(&self) -> ShimConfig
fn clone(&self) -> ShimConfig
Returns a copy 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 Default for ShimConfig
impl Default for ShimConfig
source§fn default() -> ShimConfig
fn default() -> ShimConfig
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for ShimConfigwhere
ShimConfig: Default,
impl<'de> Deserialize<'de> for ShimConfigwhere ShimConfig: Default,
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<ShimConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<ShimConfig, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for ShimConfig
impl PartialEq for ShimConfig
source§fn eq(&self, other: &ShimConfig) -> bool
fn eq(&self, other: &ShimConfig) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl Serialize for ShimConfig
impl Serialize for ShimConfig
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for ShimConfig
impl StructuralEq for ShimConfig
impl StructuralPartialEq for ShimConfig
Auto Trait Implementations§
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
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more