Struct artemis::client::Client [−][src]
An Artemis client type used to run queries against
Implementations
impl Client
[src]
pub fn builder<U: Into<String>>(url: U) -> ClientBuilder
[src]
Returns a ClientBuilder
with the given endpoint URL
impl<M: Exchange> Client<M>
[src]
pub async fn query<Q: GraphQLQuery>(
&self,
_query: Q,
variables: Q::Variables
) -> Result<Response<Q::ResponseData>, QueryError>
[src]
&self,
_query: Q,
variables: Q::Variables
) -> Result<Response<Q::ResponseData>, QueryError>
Executes a query with the given variables
Returns the result of the query, or a QueryError
if one of the exchanges encountered a fatal error.
Example
let client = ClientBuilder::new("http://localhost:8080/graphql") .with_default_exchanges() .build(); let result = client.query(GetConference, Variables { id: "1".to_string() }).await.unwrap(); assert!(result.data.is_some())
pub async fn query_with_options<Q: GraphQLQuery>(
&self,
_query: Q,
variables: Q::Variables,
options: QueryOptions
) -> Result<Response<Q::ResponseData>, QueryError>
[src]
&self,
_query: Q,
variables: Q::Variables,
options: QueryOptions
) -> Result<Response<Q::ResponseData>, QueryError>
Executes a query with the given variables and options
Returns the result of the query, or a QueryError
if one of the exchanges encountered a fatal error.
Example
let client = ClientBuilder::new("http://localhost:8080/graphql") .with_default_exchanges() .build(); let result = client.query(GetConference, Variables { id: "1".to_string() }).await.unwrap(); assert!(result.data.is_some())
pub fn subscribe<Q: GraphQLQuery + 'static>(
&self,
query: Q,
variables: Q::Variables
) -> Observable<Result<Response<<Q as GraphQLQuery>::ResponseData>, QueryError>, M>
[src]
&self,
query: Q,
variables: Q::Variables
) -> Observable<Result<Response<<Q as GraphQLQuery>::ResponseData>, QueryError>, M>
Subscribes to a query, returning any potential early results, the initial result and any future updates
The function returns an Observable
which can be subscribed to like a regular stream.
Dropping the Observable
will cancel the subscription.
Requires feature: observable
Example
let client = ClientBuilder::new("http://localhost:8080/graphql") .with_default_exchanges() .build(); let mut observable = client.subscribe(GetConference, Variables { id: "1".to_string() }); let result = observable.next().await.unwrap().unwrap(); assert!(result.data.is_some())
pub fn subscribe_with_options<Q: GraphQLQuery + 'static>(
&self,
_query: Q,
variables: Q::Variables,
options: QueryOptions
) -> Observable<Result<Response<<Q as GraphQLQuery>::ResponseData>, QueryError>, M>
[src]
&self,
_query: Q,
variables: Q::Variables,
options: QueryOptions
) -> Observable<Result<Response<<Q as GraphQLQuery>::ResponseData>, QueryError>, M>
Subscribes to a query with options, returning any potential early results, the initial result and any future updates
The function returns an Observable
which can be subscribed to like a regular stream.
Dropping the Observable
will cancel the subscription.
Requires feature: observable
Example
let client = ClientBuilder::new("http://localhost:8080/graphql") .with_default_exchanges() .build(); let mut observable = client.subscribe(GetConference, Variables { id: "1".to_string() }); let result = observable.next().await.unwrap().unwrap(); assert!(result.data.is_some())
Trait Implementations
Auto Trait Implementations
impl<M = TerminatorExchange> !RefUnwindSafe for Client<M>
impl<M> Send for Client<M>
impl<M> Sync for Client<M>
impl<M> Unpin for Client<M>
impl<M = TerminatorExchange> !UnwindSafe for Client<M>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,