Skip to main content

InputProvider

Struct InputProvider 

Source
pub struct InputProvider<C: Contract> { /* private fields */ }
Expand description

Bridges a selected input contract into the ordinary provider/consumer graph. Consumers declare Requirement::on(provider.handle()) as for any renderer.

Implementations§

Source§

impl<C: Contract> InputProvider<C>

Source

pub fn new( registry: Arc<InputRegistry>, format: impl Into<String>, source: impl Into<PathBuf>, ) -> Self

Source

pub fn using(self, provider: impl Into<String>) -> Self

Source

pub fn with_options(self, options: InputOptions) -> Self

Source

pub fn handle(&self) -> Handle<C>

Trait Implementations§

Source§

impl<C: Contract, L: Language> Plugin<L> for InputProvider<C>

Source§

fn supports_native_input(&self) -> bool

Opt in when this plugin reads protocol contracts instead of the legacy HTTP context. Native generation skips packages containing HTTP-only plugins before loading sources.
Source§

fn kind(&self) -> &'static str

Source§

fn meta(&self) -> &Meta

Source§

fn provides(&self) -> Vec<Provision>

Source§

fn generate(&self, cx: &mut PluginContext<'_, L>) -> Result<()>

Source§

fn phase(&self) -> PluginPhase

Selects the plugin lifecycle phase. The default honors Self::enforce so a post plugin only needs to override that shorthand.
Source§

fn enforce(&self) -> Enforce

Phase shorthand. Existing plugins remain generation plugins.
Source§

fn requires(&self) -> Vec<Requirement>

Auto Trait Implementations§

§

impl<C> !RefUnwindSafe for InputProvider<C>

§

impl<C> !UnwindSafe for InputProvider<C>

§

impl<C> Freeze for InputProvider<C>
where PhantomData<fn() -> C>: Freeze,

§

impl<C> Send for InputProvider<C>
where PhantomData<fn() -> C>: Send,

§

impl<C> Sync for InputProvider<C>
where PhantomData<fn() -> C>: Sync,

§

impl<C> Unpin for InputProvider<C>
where PhantomData<fn() -> C>: Unpin,

§

impl<C> UnsafeUnpin for InputProvider<C>
where PhantomData<fn() -> C>: UnsafeUnpin,

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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.