Trait UseProvider

Source
pub trait UseProvider<Args> {
    type Output: Clone + PartialEq + Send + Sync + 'static;
    type Error: Clone + Send + Sync + 'static;

    // Required method
    fn use_provider(
        self,
        args: Args,
    ) -> Signal<AsyncState<Self::Output, Self::Error>>;
}
Expand description

Trait for unified provider usage - automatically handles providers with and without parameters

This trait is implemented for all Provider types and provides a unified interface for using providers regardless of whether they take parameters or not.

Required Associated Types§

Source

type Output: Clone + PartialEq + Send + Sync + 'static

The type of data returned on success

Source

type Error: Clone + Send + Sync + 'static

The type of error returned on failure

Required Methods§

Source

fn use_provider( self, args: Args, ) -> Signal<AsyncState<Self::Output, Self::Error>>

Use the provider with the given arguments

Implementors§

Source§

impl<P> UseProvider<i32> for P
where P: Provider<i32> + Send,

Implementation for providers with a single i32 parameter (without tuple wrapper)

Source§

impl<P> UseProvider<u32> for P
where P: Provider<u32> + Send,

Implementation for providers with a single u32 parameter (without tuple wrapper)

Source§

impl<P> UseProvider<()> for P
where P: Provider<()> + Send,

Implementation for providers with no parameters (simple providers)

Source§

impl<P> UseProvider<String> for P
where P: Provider<String> + Send,

Implementation for providers with a single String parameter (without tuple wrapper)

Source§

impl<P, Param> UseProvider<(Param,)> for P
where P: Provider<Param> + Send, Param: Clone + PartialEq + Hash + Debug + Send + Sync + 'static,

Implementation for providers with parameters (parameterized providers)

Source§

type Output = <P as Provider<Param>>::Output

Source§

type Error = <P as Provider<Param>>::Error