pub struct Environment(/* private fields */);Expand description
The environment a document is interpolated against.
Implementations§
Source§impl Environment
impl Environment
pub fn new(variables: impl IntoIterator<Item = (OsString, OsString)>) -> Self
Sourcepub fn interpolate(
&self,
document: &mut Value,
) -> Result<(), InterpolationError>
pub fn interpolate( &self, document: &mut Value, ) -> Result<(), InterpolationError>
Substitutes every string leaf in document, in place.
Keys and table names are never touched: a variable that could name a setting rather than a value would make the shape of the configuration depend on the environment, which is not something an operator reading the file could follow.
Auto Trait Implementations§
impl Freeze for Environment
impl RefUnwindSafe for Environment
impl Send for Environment
impl Sync for Environment
impl Unpin for Environment
impl UnsafeUnpin for Environment
impl UnwindSafe for Environment
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more