pub trait DataFromRequest<T: DeserializeOwned + Unpin>: Sealed {
// Required method
fn data(self) -> DataFuture<T> ⓘ;
}Expand description
Extension trait for typed request builder objects.
Allows the user to retrieve the deserialized model directly from the request builder without
going through the Response<T> object.
Required Methods§
Sourcefn data(self) -> DataFuture<T> ⓘ
fn data(self) -> DataFuture<T> ⓘ
Consume the request builder and deserialize the body into the request’s matching model.
§Examples
use modio::types::id::Id;
use modio::types::mods::Mod;
use modio::util::DataFromRequest;
let mod_: Mod = client.get_mod(Id::new(51), Id::new(123)).data().await?;
println!("name: {}", mod_.name);