[][src]Struct rapture::script::Script

pub struct Script { /* fields omitted */ }

This object represents the core of the installation process. In the future, I would like to make the scripts more complex. Right now they're just a single instruction per line, and there is very little to work with when writing a rapture script.

If I can implement an embedded language similar to but simpler than lua, that would be helpful.

Methods

impl Script[src]

This object represents an executable rapture script

pub fn new<S: ToString>(script: S) -> Self[src]

This instantiates a new script with script as the script contents

pub fn command<S: Display>(&self, cmd: S) -> Result<(), String>[src]

Runs a given command on the proper operating system's shell. If the script has a package declaration, call the command within the package installation directory.

For example: if the package is named wonderful, and I call cat main.rs, the following command will be run instead: cd /home/USERNAME/.rapture/wonderful; cat main.rs

If I dont declare the package name before running a command, the exact command you gave this function is executed instead.

pub fn run(&mut self) -> Result<(), String>[src]

This function runs the rapture script. It iterates over the lines in the script, and matches the commands and the arguments. I would like to change this in the future, replacing it with an embeddable scripting language.

Trait Implementations

impl Clone for Script[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Display for Script[src]

Auto Trait Implementations

impl Send for Script

impl Sync for Script

Blanket Implementations

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

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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

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.

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

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

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