Struct irust_repl::Repl

source ·
pub struct Repl {
    pub cargo: Cargo,
    /* private fields */
}

Fields§

§cargo: Cargo

Implementations§

source§

impl Repl

source

pub fn new( toolchain: ToolChain, executor: Executor, main_result: MainResult, edition: Edition, prelude_parent_path: Option<PathBuf> ) -> Result<Self, Box<dyn Error>>

source

pub fn set_executor(&mut self, executor: Executor) -> Result<(), Box<dyn Error>>

source

pub fn update_from_extern_main_file(&mut self) -> Result<(), Box<dyn Error>>

source

pub fn hard_load(&mut self, code: impl ToString, cursor: usize)

source

pub fn insert(&mut self, input: impl ToString)

source

pub fn reset(&mut self) -> Result<(), Box<dyn Error>>

source

pub fn show(&self) -> String

source

pub fn eval( &mut self, input: impl ToString ) -> Result<EvalResult, Box<dyn Error>>

source

pub fn eval_with_configuration( &mut self, eval_config: EvalConfig<'_, impl ToString> ) -> Result<EvalResult, Box<dyn Error>>

source

pub fn eval_build( &mut self, input: impl ToString ) -> Result<EvalResult, Box<dyn Error>>

source

pub fn eval_check( &mut self, buffer: String ) -> Result<EvalResult, Box<dyn Error>>

source

pub fn eval_in_tmp_repl_without_io<T>( &mut self, input: String, f: impl FnMut(&Self) -> Result<T, Box<dyn Error>> ) -> Result<T, Box<dyn Error>>

source

pub fn eval_in_tmp_repl<T>( &mut self, input: String, f: impl FnMut(&Self) -> Result<T, Box<dyn Error>> ) -> Result<T, Box<dyn Error>>

source

pub fn toolchain(&self) -> ToolChain

source

pub fn set_toolchain(&mut self, toolchain: ToolChain)

source

pub fn set_main_result(&mut self, main_result: MainResult)

source

pub fn add_dep(&self, dep: &[String]) -> Result<Child>

source

pub fn build(&self) -> Result<Child>

source

pub fn write(&self) -> Result<()>

source

pub fn body(&self) -> String

source

pub fn write_to_extern(&self) -> Result<()>

source

pub fn with_lib<T>(&self, f: impl Fn() -> T) -> Result<T>

source

pub fn pop(&mut self)

source

pub fn del(&mut self, line_num: &str) -> Result<(), Box<dyn Error>>

source

pub fn lines(&self) -> impl Iterator<Item = &String>

source

pub fn lines_count(&self) -> usize

Trait Implementations§

source§

impl Clone for Repl

source§

fn clone(&self) -> Repl

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 Repl

source§

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

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

impl Default for Repl

source§

fn default() -> Self

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

impl Drop for Repl

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for Repl

§

impl Send for Repl

§

impl Sync for Repl

§

impl Unpin for Repl

§

impl UnwindSafe for Repl

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