Skip to main content

BuildCtx

Struct BuildCtx 

Source
pub struct BuildCtx<'a> { /* private fields */ }
Expand description

Handed to a PluginFactory while constructing one instance.

Implementations§

Source§

impl<'a> BuildCtx<'a>

Source

pub fn new( name: &'a str, config: &'a Map<String, Value>, meta: &'a PipelineMeta, stage: StageInfo<'a>, host: &'a mut dyn HostBuilder, ) -> Self

Source

pub fn stage(&self) -> StageInfo<'a>

Where this instance sits in the pipeline. Cache anything derived from it as the position cannot change after construction.

Source

pub fn name(&self) -> &str

Source

pub fn meta(&self) -> &PipelineMeta

Source

pub fn direction(&self) -> Direction

Source

pub fn raw_config(&self) -> &Map<String, Value>

Source

pub fn config<T: DeserializeOwned>(&self) -> Result<T>

Deserialize the entry’s options into the plugin’s own config type.

Through Forgiving, so option keys and enum values are matched the way every other identifier in tocat is: case-insensitively, with dashes and underscores treated as noise. A plugin declares its config exactly as it would otherwise, including deny_unknown_fields, and needs to know nothing about this.

Source

pub fn open_channel(&mut self, target: ChannelTarget) -> Result<ChannelId>

Reserve a side channel. Equal targets share one handle process-wide.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for BuildCtx<'a>

§

impl<'a> !Send for BuildCtx<'a>

§

impl<'a> !Sync for BuildCtx<'a>

§

impl<'a> !UnwindSafe for BuildCtx<'a>

§

impl<'a> Freeze for BuildCtx<'a>

§

impl<'a> Unpin for BuildCtx<'a>

§

impl<'a> UnsafeUnpin for BuildCtx<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.