pub struct ExternalSource {
pub sent: Vec<String>,
pub trace: bool,
/* private fields */
}Expand description
A connected adapter.
Fields§
§sent: Vec<String>Every request line sent, without the newline (for tests and traces).
trace: boolKeep the trace (off by default: production sends are not retained).
Implementations§
Source§impl ExternalSource
impl ExternalSource
Sourcepub fn spawn(
command: &str,
args: &[String],
env: &BTreeMap<String, String>,
) -> Result<Self>
pub fn spawn( command: &str, args: &[String], env: &BTreeMap<String, String>, ) -> Result<Self>
Spawn command args… with env merged over the parent’s and connect.
Sourcepub fn spawn_source(source: &SourceRow, adapter: &AdapterRow) -> Result<Self>
pub fn spawn_source(source: &SourceRow, adapter: &AdapterRow) -> Result<Self>
Spawn a registry source: the adapter’s command, its fixed args,
then render_config_flags(source.config); the source’s env.
Sourcepub fn argv(source: &SourceRow, adapter: &AdapterRow) -> Vec<String>
pub fn argv(source: &SourceRow, adapter: &AdapterRow) -> Vec<String>
The argv an adapter is spawned with (§5), for callers that log it.
Sourcepub fn connect(
label: &str,
from_adapter: impl Read + Send + 'static,
to_adapter: impl Write + Send + 'static,
) -> Result<Self>
pub fn connect( label: &str, from_adapter: impl Read + Send + 'static, to_adapter: impl Write + Send + 'static, ) -> Result<Self>
Connect over an arbitrary pair of streams (the adapter’s stdout to
read, its stdin to write) — a test or a runner playing a scripted
adapter over pipes. label names the adapter in errors.
Trait Implementations§
Source§impl Debug for ExternalSource
impl Debug for ExternalSource
Source§impl Drop for ExternalSource
impl Drop for ExternalSource
Source§impl SyncSource for ExternalSource
impl SyncSource for ExternalSource
Source§fn unwatch(&mut self) -> Result<()>
fn unwatch(&mut self) -> Result<()>
Stop listening, then unwatch; a failure (the process may be
exiting) is ignored.
Source§fn close(&mut self) -> Result<()>
fn close(&mut self) -> Result<()>
Close stdin (EOF), give the adapter a moment to exit, then SIGTERM, then SIGKILL; reap it.
fn capabilities(&self) -> SourceCapabilities
Source§fn fetch(&mut self, path: &str) -> Result<Option<SourceItem>>
fn fetch(&mut self, path: &str) -> Result<Option<SourceItem>>
None when it left the scope.