Struct Call

Source
pub struct Call { /* private fields */ }
Expand description

Interface to talk with a http server

Implementations§

Source§

impl Call

Source

pub fn new(url: &Url) -> Call

create a new call object with url as endpoint

Source

pub fn set_url_query(&mut self, q: Option<&str>)

change url objects query information

Source

pub fn get_base(&self) -> &Url

return reference t base url object

Source

pub fn request<S: Serialize>( &self, method: CallMethod, path: &str, body: Option<&S>, ) -> GGRResult<CallResponse>

call the do_request function two times. One with digest and the other with basic http authentication methods. The first success returnes a CallResponse

Source

pub fn get(&self, path: &str) -> GGRResult<CallResponse>

Convenience method that performs a GET request.

Source

pub fn delete(&self, path: &str) -> GGRResult<CallResponse>

Convenience method that performs a DELETE request.

Source

pub fn post<S: Serialize>( &self, path: &str, body: &S, ) -> GGRResult<CallResponse>

Convenience method that performs a POST request with JSON data.

Source

pub fn put<S: Serialize>(&self, path: &str, body: &S) -> GGRResult<CallResponse>

Convenience method that performs a PUT request with JSON data.

Auto Trait Implementations§

§

impl !Freeze for Call

§

impl !RefUnwindSafe for Call

§

impl Send for Call

§

impl !Sync for Call

§

impl Unpin for Call

§

impl !UnwindSafe for Call

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.