pub struct HTTP<C: HttpClient> { /* private fields */ }
Implementations§
Source§impl<C> HTTP<C>where
C: HttpClient + Default,
impl<C> HTTP<C>where
C: HttpClient + Default,
Sourcepub fn new(
app_name: String,
instance_id: String,
connection_id: String,
authorization: Option<String>,
) -> Result<Self, C::Error>
pub fn new( app_name: String, instance_id: String, connection_id: String, authorization: Option<String>, ) -> Result<Self, C::Error>
The error type on this will change in future.
Sourcepub fn get(&self, uri: &str) -> C::RequestBuilder
pub fn get(&self, uri: &str) -> C::RequestBuilder
Perform a GET. Returns errors per HttpClient::get.
Sourcepub async fn get_json<T: DeserializeOwned>(
&self,
endpoint: &str,
interval: Option<u64>,
) -> Result<T, C::Error>
pub async fn get_json<T: DeserializeOwned>( &self, endpoint: &str, interval: Option<u64>, ) -> Result<T, C::Error>
Make a get request and parse into JSON
Sourcepub fn post(&self, uri: &str) -> C::RequestBuilder
pub fn post(&self, uri: &str) -> C::RequestBuilder
Perform a POST. Returns errors per HttpClient::post.
Auto Trait Implementations§
impl<C> Freeze for HTTP<C>
impl<C> RefUnwindSafe for HTTP<C>
impl<C> Send for HTTP<C>
impl<C> Sync for HTTP<C>
impl<C> Unpin for HTTP<C>
impl<C> UnwindSafe for HTTP<C>
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