[−][src]Struct rapture::script::Script
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(&self) -> 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
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,