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

source

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.

source

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).

source

pub fn local<B>(bin_path: B) -> ShimConfigwhere B: AsRef<OsStr>,

Create a local shim that executes the provided binary.

source

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

source§

fn clone(&self) -> ShimConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ShimConfig

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Default for ShimConfig

source§

fn default() -> ShimConfig

Returns the “default value” for a type. Read more
source§

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>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl PartialEq for ShimConfig

source§

fn eq(&self, other: &ShimConfig) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for ShimConfig

source§

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
source§

impl Eq for ShimConfig

source§

impl StructuralEq for ShimConfig

source§

impl StructuralPartialEq for ShimConfig

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

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,

source§

fn equivalent(&self, key: &K) -> bool

§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<Q> ToOwnedEquivalent<<Q as ToOwned>::Owned> for Qwhere Q: ToOwned + Eq + ?Sized,

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,