pub struct PluginSpec {
pub name: String,
pub direction: DirectionSpec,
pub alias: Option<String>,
pub detach: Option<bool>,
pub config: Map<String, Value>,
}Expand description
A declared pipeline entry: which plugin, on which path, with what config.
In TOML the plugin’s own options are flattened alongside name and
direction:
[[plugin]]
name = "tee"
direction = "both"
file = "dump.log"
format = "hex"Fields§
§name: String§direction: DirectionSpec§alias: Option<String>A name for this instance, used in logs and as the default label for
stages that print one. Without it a stage is called after its plugin,
with #n appended when the same plugin appears twice on one path.
detach: Option<bool>Override the plugin’s default placement. true runs this stage on its
own task behind a bounded channel.
config: Map<String, Value>Plugin-defined options, opaque to the host.
Implementations§
Source§impl PluginSpec
impl PluginSpec
pub fn new(name: impl Into<String>, direction: DirectionSpec) -> Self
pub fn named(self, alias: impl Into<String>) -> Self
pub fn detached(self, detach: bool) -> Self
pub fn with(self, key: impl Into<String>, value: impl Into<Value>) -> Self
pub fn set( &mut self, key: impl Into<String>, value: impl Into<Value>, ) -> &mut Self
Trait Implementations§
Source§impl Clone for PluginSpec
impl Clone for PluginSpec
Source§fn clone(&self) -> PluginSpec
fn clone(&self) -> PluginSpec
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PluginSpec
impl Debug for PluginSpec
Source§impl Default for PluginSpec
impl Default for PluginSpec
Source§fn default() -> PluginSpec
fn default() -> PluginSpec
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for PluginSpec
impl<'de> Deserialize<'de> for PluginSpec
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for PluginSpec
impl Display for PluginSpec
Auto Trait Implementations§
impl Freeze for PluginSpec
impl RefUnwindSafe for PluginSpec
impl Send for PluginSpec
impl Sync for PluginSpec
impl Unpin for PluginSpec
impl UnsafeUnpin for PluginSpec
impl UnwindSafe for PluginSpec
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
Mutably borrows from an owned value. Read more