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§
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,
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.