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
impl StructuralPartialEq for DriverSpec
Auto Trait Implementations§
impl Freeze for DriverSpec
impl RefUnwindSafe for DriverSpec
impl Send for DriverSpec
impl Sync for DriverSpec
impl Unpin for DriverSpec
impl UnsafeUnpin for DriverSpec
impl UnwindSafe for DriverSpec
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.