UseProvider

Trait UseProvider 

Source
pub trait UseProvider<Args> {
    type Output: ProviderOutputBounds;
    type Error: ProviderErrorBounds;

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

Unified trait for using providers with any parameter format

This trait provides a single, unified interface for using providers regardless of their parameter format. It automatically handles:

  • No parameters ()
  • Tuple parameters (param,)
  • Direct parameters param

Required Associated Types§

Source

type Output: ProviderOutputBounds

The type of data returned on success

Source

type Error: ProviderErrorBounds

The type of error returned on failure

Required Methods§

Source

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

Use the provider with the given arguments

Implementors§

Source§

impl<P, Args> UseProvider<Args> for P
where P: Provider<Args::Param> + Clone, Args: IntoProviderParam,

Unified implementation for all providers using parameter normalization

This single implementation replaces all the previous repetitive implementations by using the IntoProviderParam trait to normalize different parameter formats.