Struct DummyVM

Source
pub struct DummyVM { /* private fields */ }
Expand description

Open the Python interpreter as a server and act as an Erg interpreter by mediating communication

Pythonインタープリタをサーバーとして開き、通信を仲介することでErgインタープリタとして振る舞う

Implementations§

Source§

impl DummyVM

Source

pub fn new(cfg: ErgConfig) -> Self

Source

pub fn exec(&mut self) -> Result<ExitStatus, CompileErrors>

Execute the script specified in the configuration.

Source

pub fn eval(&mut self, src: String) -> Result<String, CompileErrors>

Evaluates code passed as a string.

Trait Implementations§

Source§

impl Debug for DummyVM

Source§

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

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

impl Default for DummyVM

Source§

fn default() -> Self

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

impl Drop for DummyVM

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl New for DummyVM

Source§

fn new(cfg: ErgConfig) -> Self

Source§

impl Runnable for DummyVM

Source§

const NAME: &'static str = "Erg interpreter"

Source§

type Err = CompileError

Source§

type Errs = CompileErrors

Source§

fn cfg(&self) -> &ErgConfig

Source§

fn cfg_mut(&mut self) -> &mut ErgConfig

Source§

fn finish(&mut self)

Source§

fn initialize(&mut self)

Erase all but immutable information.
Source§

fn clear(&mut self)

Erase information that will no longer be meaningful in the next iteration
Source§

fn exec(&mut self) -> Result<ExitStatus, Self::Errs>

Source§

fn eval(&mut self, src: String) -> Result<String, CompileErrors>

Source§

fn expect_block(&self, src: &str) -> BlockKind

Source§

fn input(&self) -> &Input

Source§

fn set_input(&mut self, input: Input)

Source§

fn start_message(&self) -> String

Source§

fn ps1(&self) -> String

Source§

fn ps2(&self) -> String

Source§

fn quit(&mut self, code: i32) -> !

Source§

fn quit_successfully(&mut self, output: BufWriter<StdoutLock<'_>>) -> !

Source§

fn run(cfg: ErgConfig) -> ExitStatus

Auto Trait Implementations§

§

impl !Freeze for DummyVM

§

impl !RefUnwindSafe for DummyVM

§

impl !Send for DummyVM

§

impl !Sync for DummyVM

§

impl Unpin for DummyVM

§

impl !UnwindSafe for DummyVM

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.