pub struct ErgConfig {
Show 17 fields pub mode: &'static str, pub opt_level: u8, pub no_std: bool, pub py_magic_num: Option<u32>, pub py_command: Option<&'static str>, pub target_version: Option<PythonVersion>, pub py_server_timeout: u64, pub python_compatible_mode: bool, pub quiet_repl: bool, pub show_type: bool, pub input: Input, pub output_dir: Option<&'static str>, pub module: &'static str, pub verbose: u8, pub ps1: &'static str, pub ps2: &'static str, pub runtime_args: Vec<&'static str>,
}

Fields§

§mode: &'static str

options: lex | parse | compile | exec

§opt_level: u8

optimization level.

  • 0: no optimization
  • 1 (default): e.g. constant folding, dead code elimination
  • 2: e.g. static dispatching, inlining, peephole
  • 3: e.g. JIT compiling
§no_std: bool§py_magic_num: Option<u32>§py_command: Option<&'static str>§target_version: Option<PythonVersion>§py_server_timeout: u64§python_compatible_mode: bool§quiet_repl: bool§show_type: bool§input: Input§output_dir: Option<&'static str>§module: &'static str

module name to be executed

§verbose: u8

verbosity level for system messages.

  • 0: display errors, warns
  • 1 (default): display errors, warnings and hints
§ps1: &'static str

needed for jupyter-erg

§ps2: &'static str§runtime_args: Vec<&'static str>

Implementations§

cloneのエイリアス(実際のcloneコストは低いので)

Examples found in repository?
config.rs (line 296)
292
293
294
295
296
297
298
    pub fn inherit(&self, path: PathBuf) -> Self {
        Self {
            module: Box::leak(path.to_str().unwrap().to_string().into_boxed_str()),
            input: Input::File(path),
            ..self.copy()
        }
    }
Examples found in repository?
config.rs (line 275)
274
275
276
277
278
279
280
281
    pub fn dump_pyc_path(&self) -> String {
        let dump_path = self.dump_path();
        if dump_path.ends_with(".er") {
            dump_path.replace(".er", ".pyc")
        } else {
            dump_path + ".pyc"
        }
    }
Examples found in repository?
config.rs (line 284)
283
284
285
286
287
288
289
290
    pub fn dump_pyc_filename(&self) -> String {
        let dump_filename = self.dump_filename();
        if dump_filename.ends_with(".er") {
            dump_filename.replace(".er", ".pyc")
        } else {
            dump_filename + ".pyc"
        }
    }

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.