pub struct Client { /* private fields */ }
Expand description
Client for Edgee endpoints
Version: 1
Implementations§
Source§impl Client
impl Client
Sourcepub fn new(baseurl: &str) -> Self
pub fn new(baseurl: &str) -> Self
Create a new client.
baseurl
is the base URL provided to the internal
reqwest::Client
, and should include a scheme and hostname,
as well as port and a path stem if applicable.
Sourcepub fn new_with_client(baseurl: &str, client: Client) -> Self
pub fn new_with_client(baseurl: &str, client: Client) -> Self
Construct a new client with an existing reqwest::Client
,
allowing more control over its configuration.
baseurl
is the base URL provided to the internal
reqwest::Client
, and should include a scheme and hostname,
as well as port and a path stem if applicable.
Source§impl Client
impl Client
Sourcepub fn collect_event(&self) -> CollectEvent<'_>
pub fn collect_event(&self) -> CollectEvent<'_>
Collect a new Edgee event
Collects a new Edgee event at the edge and forwards it to the configured components.
Sends a POST
request to /_edgee/event
ⓘ
let response = client.collect_event()
.body(body)
.send()
.await;
Trait Implementations§
Source§impl ClientHooks for &Client
impl ClientHooks for &Client
Source§async fn pre<E>(
&self,
request: &mut Request,
info: &OperationInfo,
) -> Result<(), Error<E>>
async fn pre<E>( &self, request: &mut Request, info: &OperationInfo, ) -> Result<(), Error<E>>
Runs prior to the execution of the request. This may be used to modify
the request before it is transmitted.
Source§impl ClientInfo<()> for Client
impl ClientInfo<()> for Client
Source§fn api_version() -> &'static str
fn api_version() -> &'static str
Get the version of this API. Read more
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