pub enum ReplDriverSpec {
Line,
Multiline,
External {
cmd: String,
},
Buffer {
path: PathBuf,
on: Symbol,
},
Unavailable {
spec: Expr,
},
}Expand description
Declarative description of a REPL line driver, resolved into a concrete
LineDriver by DriverSpec::create_driver.
Variants§
Line
Single-line stdio driver.
Multiline
Multi-line stdio driver.
External
External process driver invoking cmd.
Buffer
Buffer-file driver reading from path.
Fields
A driver named in the spec but not built in; resolved from the registry at creation time or reported as unavailable.
Implementations§
Source§impl DriverSpec
impl DriverSpec
Sourcepub fn from_expr(expr: &Expr) -> Result<Self>
pub fn from_expr(expr: &Expr) -> Result<Self>
Parses a driver spec from expr: a driver symbol (line, multiline,
…) or a (kind ...) option list. Returns an error for malformed specs.
Sourcepub fn as_expr(&self) -> Expr
pub fn as_expr(&self) -> Expr
Renders this spec back into its Expr form, the inverse of
DriverSpec::from_expr.
Sourcepub fn create_driver(&self, cx: &mut Cx) -> Result<Box<dyn LineDriver>>
pub fn create_driver(&self, cx: &mut Cx) -> Result<Box<dyn LineDriver>>
Builds the concrete LineDriver for this spec, consulting the driver
registry for DriverSpec::Unavailable specs and erroring if none is found.
Sourcepub fn required_capabilities(&self) -> Vec<CapabilityName>
pub fn required_capabilities(&self) -> Vec<CapabilityName>
Returns the capabilities required to use this driver spec.
Trait Implementations§
Source§impl Clone for DriverSpec
impl Clone for DriverSpec
Source§fn clone(&self) -> DriverSpec
fn clone(&self) -> DriverSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DriverSpec
impl Debug for DriverSpec
impl Eq for DriverSpec
Source§impl PartialEq for DriverSpec
impl PartialEq for DriverSpec
Source§fn eq(&self, other: &DriverSpec) -> bool
fn eq(&self, other: &DriverSpec) -> bool
self and other values to be equal, and is used by ==.