pub struct Client { /* private fields */ }Implementations§
Source§impl Client
impl Client
Sourcepub fn new<U: Into<String>>(url: U) -> Self
pub fn new<U: Into<String>>(url: U) -> Self
Examples found in repository?
examples/client.rs (line 10)
8fn main() {
9 // This example uses fake JSON:API
10 let client = Client::new("https://jsonapiplayground.reyesoft.com/v2");
11
12 let response: Response = client
13 .get("/stores", &[("filter[created_by]", "1,3".to_string())])
14 .unwrap();
15
16 let document: &Document = response.document();
17
18 println!("{:#?}", document);
19}pub fn add_json_ext(self, add_json_ext: bool) -> Self
Sourcepub fn get<P, I, K, V>(&self, path: P, params: I) -> Resultwhere
P: Display,
I: IntoIterator,
K: AsRef<str>,
V: AsRef<str>,
<I as IntoIterator>::Item: Borrow<(K, V)>,
pub fn get<P, I, K, V>(&self, path: P, params: I) -> Resultwhere
P: Display,
I: IntoIterator,
K: AsRef<str>,
V: AsRef<str>,
<I as IntoIterator>::Item: Borrow<(K, V)>,
Examples found in repository?
examples/client.rs (line 13)
8fn main() {
9 // This example uses fake JSON:API
10 let client = Client::new("https://jsonapiplayground.reyesoft.com/v2");
11
12 let response: Response = client
13 .get("/stores", &[("filter[created_by]", "1,3".to_string())])
14 .unwrap();
15
16 let document: &Document = response.document();
17
18 println!("{:#?}", document);
19}pub fn post<'d, P, D>(&self, path: P, document: D) -> Result
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnwindSafe for Client
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more