[−][src]Struct rant::Rant
A Rant execution context.
Implementations
impl Rant
[src]
pub fn new() -> Self
[src]
Creates a new Rant context with the default seed (0) and loads the standard library.
pub fn with_seed(seed: u64) -> Self
[src]
Creates a new Rant context with the specified seed and loads the standard library.
impl Rant
[src]
#[must_use =
"compiling a program without storing or running it achieves nothing"]pub fn compile<R: Reporter>(
&self,
source: &str,
reporter: &mut R
) -> CompileResult
[src]
&self,
source: &str,
reporter: &mut R
) -> CompileResult
Compiles a source string using the specified reporter.
#[must_use =
"compiling a program without storing or running it achieves nothing"]pub fn compile_quiet(&self, source: &str) -> CompileResult
[src]
Compiles a source string without reporting problems.
#[must_use =
"compiling a program without storing or running it achieves nothing"]pub fn compile_file<P: AsRef<Path>, R: Reporter>(
&self,
path: P,
reporter: &mut R
) -> CompileResult
[src]
&self,
path: P,
reporter: &mut R
) -> CompileResult
Compiles a source file using the specified reporter.
#[must_use =
"compiling a program without storing or running it achieves nothing"]pub fn compile_file_quiet<P: AsRef<Path>>(&self, path: P) -> CompileResult
[src]
Compiles a source file without reporting problems.
pub fn globals(&self) -> RantMapRef
[src]
Gets the global variable map of the Rant context.
pub fn seed(&self) -> u64
[src]
Gets the current RNG seed.
pub fn set_seed(&mut self, seed: u64)
[src]
Re-seeds the RNG with the specified seed.
pub fn reset_seed(&mut self)
[src]
Resets the RNG back to its initial state with the current seed.
pub fn run(&mut self, program: &RantProgram) -> Result<String, RuntimeError>
[src]
Runs the specified program.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Rant
impl !Send for Rant
impl !Sync for Rant
impl Unpin for Rant
impl !UnwindSafe for Rant
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
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<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,