Trait ResourceTrait

Source
pub trait ResourceTrait<Component> {
    // Required methods
    fn update_resource<Type>(
        &self,
        f: impl FnOnce(&Component) -> &Resource<Type>,
        future: impl Future<Output = Option<Type>> + 'static,
    )
       where Type: Clone + 'static;
    fn acquire_resource<Type>(
        &self,
        f: impl FnMut(&Component) -> &Resource<Type>,
        future: impl Future<Output = Option<Type>> + 'static,
    ) -> ResourceState<Type>
       where Type: Clone + 'static;
    fn web_get<Type>(
        &self,
        f: impl FnMut(&Component) -> &Resource<Type>,
        url: String,
    ) -> ResourceState<Type>
       where Type: Clone + 'static + DeserializeOwned;
    fn web_post<Type>(
        &self,
        f: impl FnMut(&Component) -> &Resource<Type>,
        url: String,
        body: impl Serialize + 'static,
    ) -> ResourceState<Type>
       where Type: Clone + 'static + DeserializeOwned;
}

Required Methods§

Source

fn update_resource<Type>( &self, f: impl FnOnce(&Component) -> &Resource<Type>, future: impl Future<Output = Option<Type>> + 'static, )
where Type: Clone + 'static,

Source

fn acquire_resource<Type>( &self, f: impl FnMut(&Component) -> &Resource<Type>, future: impl Future<Output = Option<Type>> + 'static, ) -> ResourceState<Type>
where Type: Clone + 'static,

Source

fn web_get<Type>( &self, f: impl FnMut(&Component) -> &Resource<Type>, url: String, ) -> ResourceState<Type>
where Type: Clone + 'static + DeserializeOwned,

Source

fn web_post<Type>( &self, f: impl FnMut(&Component) -> &Resource<Type>, url: String, body: impl Serialize + 'static, ) -> ResourceState<Type>
where Type: Clone + 'static + DeserializeOwned,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<Component> ResourceTrait<Component> for Signal<Component>