[][src]Struct zap_model::task::Script

pub struct Script {
    pub inline: Option<String>,
    pub file: Option<PathBuf>,
}

A Script represents something that can be executed oa a remote host.

These come in two variants:

  • Inline string of shell commands to run
  • A script or binary file to transfer and execute

Fields

inline: Option<String>

Inline scripts will have parameters rendered into then with handlebars syntax

file: Option<PathBuf>

File scripts will be executed with the parameters passed as command line arguments, e.g. the "msg" parameter would be passed as: ./file --msg=value

Implementations

impl Script[src]

pub fn has_file(&self) -> bool[src]

pub fn as_bytes(
    &self,
    parameters: Option<&HashMap<String, String>>
) -> Option<Vec<u8>>
[src]

Return the script's contents as bytes

This is useful for transferring the script to another host for execution

If the file member is defined, that will be preferred, even if inline is also defined

Trait Implementations

impl Clone for Script[src]

impl Debug for Script[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.