pub struct SourceConfig { /* private fields */ }Expand description
One named source, as a document configures it.
Built by Config::from_document, never deserialized directly: plugin is a
PluginKind rather than the string the document spelled, so a source naming a
plugin this build does not have cannot be represented here at all.
Implementations§
Source§impl SourceConfig
impl SourceConfig
Sourcepub fn plugin(&self) -> PluginKind
pub fn plugin(&self) -> PluginKind
The plugin kind that builds this source.
Sourcepub fn config(&self) -> &Value
pub fn config(&self) -> &Value
The plugin’s own block.
Opaque here on purpose — a plugin’s fields are the plugin’s, and typing them in
the engine would put every plugin’s shape in the engine. What holds instead is
that Config::from_document checks each block against the schema its own
plugin declares, and this field is not public, so no SourceConfig anybody can
reach carries a block that plugin would refuse.
Sourcepub fn document_dir(&self) -> Option<&Path>
pub fn document_dir(&self) -> Option<&Path>
The absolute directory holding the configuration document that supplied the
block this source hands a child process, or None when no one document did.
Only a subprocess source ever carries one: its settings: block is opaque here,
so nothing inside it is rebased in this process, and this is what the child is
told instead — document_dir in docs/plugin-protocol.md §3 — so the hosted
plugin can resolve its own declared paths exactly as the in-process rule does.
It is an engine-owned fact about where the block came from, which is why it is
read from the merge’s origins rather than being a setting anybody can write.