Environment

Struct Environment 

Source
pub struct Environment<Stdout, Stderr>
where Stdout: Write + Clone, Stderr: Write + Clone,
{ pub val_cache: BTreeMap<String, Rc<Value>>, pub op_cache: Ops, pub converter_registry: ConverterRegistry, pub importer_registry: ImporterRegistry, pub assert_results: AssertCollector, pub stdout: Stdout, pub stderr: Stderr, pub env_vars: BTreeMap<String, String>, pub out_lock: BTreeSet<PathBuf>, }

Fields§

§val_cache: BTreeMap<String, Rc<Value>>§op_cache: Ops§converter_registry: ConverterRegistry§importer_registry: ImporterRegistry§assert_results: AssertCollector§stdout: Stdout§stderr: Stderr§env_vars: BTreeMap<String, String>§out_lock: BTreeSet<PathBuf>

Implementations§

Source§

impl<Stdout: Write + Clone, Stderr: Write + Clone> Environment<Stdout, Stderr>

Source

pub fn new(out: Stdout, err: Stderr) -> Self

Source

pub fn new_with_vars( out: Stdout, err: Stderr, vars: BTreeMap<String, String>, ) -> Self

Source

pub fn get_env_vars_tuple(&self) -> Value

Source

pub fn get_cached_path_val(&self, path: &String) -> Option<Rc<Value>>

Source

pub fn update_path_val(&mut self, path: &String, val: Rc<Value>)

Source

pub fn get_ops_for_path<P>(&mut self, path: P) -> Result<OpPointer, Error>
where P: Into<PathBuf> + Clone,

Source

pub fn record_assert_result(&mut self, desc: &str, ok: bool)

Source

pub fn get_out_lock_for_path<P: AsRef<Path>>(&self, path: P) -> bool

Source

pub fn set_out_lock_for_path<P: Into<PathBuf>>(&mut self, path: P)

Source

pub fn reset_out_lock_for_path<P: AsRef<Path>>(&mut self, path: P)

Source

pub fn stdout(&self) -> Stdout

Source

pub fn stderr(&self) -> Stderr

Source

pub fn convert_val( &mut self, typ: &str, writer: &mut dyn Write, val: Rc<Val>, ) -> bool

Auto Trait Implementations§

§

impl<Stdout, Stderr> Freeze for Environment<Stdout, Stderr>
where Stdout: Freeze, Stderr: Freeze,

§

impl<Stdout, Stderr> !RefUnwindSafe for Environment<Stdout, Stderr>

§

impl<Stdout, Stderr> !Send for Environment<Stdout, Stderr>

§

impl<Stdout, Stderr> !Sync for Environment<Stdout, Stderr>

§

impl<Stdout, Stderr> Unpin for Environment<Stdout, Stderr>
where Stdout: Unpin, Stderr: Unpin,

§

impl<Stdout, Stderr> !UnwindSafe for Environment<Stdout, Stderr>

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.