Struct wasmer_backend_api::client::WasmerClient
source · pub struct WasmerClient {
auth_token: Option<String>,
graphql_endpoint: Url,
pub(crate) client: Client,
pub(crate) user_agent: HeaderValue,
log_variables: bool,
}
Expand description
API client for the Wasmer API.
Use the queries in [crate::queries
] to interact with the API.
Fields§
§auth_token: Option<String>
§graphql_endpoint: Url
§client: Client
§user_agent: HeaderValue
§log_variables: bool
Implementations§
source§impl WasmerClient
impl WasmerClient
sourceconst ENV_VAR_LOG_VARIABLES: &'static str = "WASMER_API_INSECURE_LOG_VARIABLES"
const ENV_VAR_LOG_VARIABLES: &'static str = "WASMER_API_INSECURE_LOG_VARIABLES"
Env var used to enable logging of request variables.
This is somewhat dangerous since it can log sensitive information, hence it is gated by a custom env var.
pub fn graphql_endpoint(&self) -> &Url
pub fn auth_token(&self) -> Option<&str>
fn parse_user_agent(user_agent: &str) -> Result<HeaderValue, Error>
pub fn new_with_client( client: Client, graphql_endpoint: Url, user_agent: &str, ) -> Result<Self, Error>
pub fn new(graphql_endpoint: Url, user_agent: &str) -> Result<Self, Error>
pub fn new_with_proxy( graphql_endpoint: Url, user_agent: &str, proxy: Option<Proxy>, ) -> Result<Self, Error>
pub fn with_auth_token(self, auth_token: String) -> Self
pub(crate) async fn run_graphql_raw<ResponseData, Vars>( &self, operation: Operation<ResponseData, Vars>, ) -> Result<GraphQlResponse<ResponseData>, Error>
pub(crate) async fn run_graphql<ResponseData, Vars>( &self, operation: Operation<ResponseData, Vars>, ) -> Result<ResponseData, Error>
sourcepub(crate) async fn run_graphql_strict<ResponseData, Vars>(
&self,
operation: Operation<ResponseData, Vars>,
) -> Result<ResponseData, Error>
pub(crate) async fn run_graphql_strict<ResponseData, Vars>( &self, operation: Operation<ResponseData, Vars>, ) -> Result<ResponseData, Error>
Run a GraphQL query, but fail (return an Error) if any error is returned in the response.
Trait Implementations§
source§impl Clone for WasmerClient
impl Clone for WasmerClient
source§fn clone(&self) -> WasmerClient
fn clone(&self) -> WasmerClient
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl !Freeze for WasmerClient
impl !RefUnwindSafe for WasmerClient
impl Send for WasmerClient
impl Sync for WasmerClient
impl Unpin for WasmerClient
impl !UnwindSafe for WasmerClient
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.