[−][src]Struct lightql::QlRequestTyped
A wrapper around Request where the type is contained.
Methods
impl<T> QlRequestTyped<T>
[src]
impl<T> QlRequestTyped<T>
pub fn new(query: &str) -> Self
[src]
pub fn new(query: &str) -> Self
Create a new typed request.
pub fn from_path(name: &str) -> Result<Self, Error>
[src]
pub fn from_path(name: &str) -> Result<Self, Error>
Create a typed request from a file path.
The file have to end with .(QlType)
player_request.query
or player_update.mutation
etc...
pub fn prepare(self, opt_map: HashMap<String, String>) -> Result<Self, QlError>
[src]
pub fn prepare(self, opt_map: HashMap<String, String>) -> Result<Self, QlError>
prepare the request with a hasmap for each argument
let mut param_map = Hashmap::new();
param_map.insert("_uuid", "The real value");
let response = Request::new("player(uuid: \"_uuid\") { uuid }", QlType::Query)
.prepare(param_map)
.send::<Player>()
.expect("Player cannot be retrieved");
If the is no args to the query the send should detect it, so you don't need to use prepare.
pub fn force_prepare(self) -> Self
[src]
pub fn force_prepare(self) -> Self
Force the preparation in certain case that can be usefull.
pub fn send(&self, uri: &str) -> Result<T, QlError> where
T: DeserializeOwned,
[src]
pub fn send(&self, uri: &str) -> Result<T, QlError> where
T: DeserializeOwned,
The send the request and return the requested type.
Trait Implementations
Auto Trait Implementations
impl<T> Send for QlRequestTyped<T> where
T: Send,
impl<T> Send for QlRequestTyped<T> where
T: Send,
impl<T> Sync for QlRequestTyped<T> where
T: Sync,
impl<T> Sync for QlRequestTyped<T> where
T: Sync,
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId