2019-12-07 03:09:21 -08:00
|
|
|
use crate::common::*;
|
|
|
|
|
|
|
|
/// A binding of `name` to `value`
|
2021-06-08 01:01:27 -07:00
|
|
|
#[derive(Debug, Clone, PartialEq)]
|
2019-12-07 03:09:21 -08:00
|
|
|
pub(crate) struct Binding<'src, V = String> {
|
|
|
|
/// Export binding as an environment variable to child processes
|
|
|
|
pub(crate) export: bool,
|
|
|
|
/// Binding name
|
2020-02-10 20:07:06 -08:00
|
|
|
pub(crate) name: Name<'src>,
|
2019-12-07 03:09:21 -08:00
|
|
|
/// Binding value
|
2020-02-10 20:07:06 -08:00
|
|
|
pub(crate) value: V,
|
2019-12-07 03:09:21 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
impl<'src, V> Keyed<'src> for Binding<'src, V> {
|
|
|
|
fn key(&self) -> &'src str {
|
|
|
|
self.name.lexeme()
|
|
|
|
}
|
|
|
|
}
|