Crate openiap_client

source
Expand description

The openiap.client crate provides the Client struct and its methods. For now this only support grpc, will over time have added support for web sockets, http, tcp and named pipes. Initialize a new client, by calling the Client::new_connect method.

use openiap_client::{OpenIAPError, Client, QueryRequest};
#[tokio::main]
async fn main() -> Result<(), OpenIAPError> {
    let client = Client::new_connect("").await?;
    let q = client.query( QueryRequest::with_projection(
        "entities",
        "{}",
        "{\"name\":1}"
    )).await?;
    let items: serde_json::Value = serde_json::from_str(&q.results).unwrap();
    let items: &Vec<serde_json::Value> = items.as_array().unwrap();
    for item in items {
        println!("Item: {:?}", item);
    }
    Ok(())
}

Modules§

  • The agent module provides the Agent struct and its methods.
  • The base module provides the CustomCommandRequest struct and its methods.
  • The download module provides the Download struct and its methods.
  • The errors module provides the Error struct and its methods.
  • Generated client implementations.
  • Generated server implementations.
  • The protos module provides the Envelope, ErrorResponse, SigninRequest, SigninResponse, RegisterQueueRequest, UnRegisterQueueRequest, RegisterExchangeRequest, WatchRequest, UnWatchRequest, QueueMessageRequest, QueryRequest, QueryResponse, UploadRequest, UploadResponse, DownloadRequest, DownloadResponse, WorkItem, and WorkItemResponse structs and their methods.
  • The query module provides the Query struct and its methods.
  • The queue module provides the RegisterQueueRequest, UnRegisterQueueRequest, RegisterExchangeRequest, WatchRequest, UnWatchRequest, and QueueMessageRequest structs and their methods.
  • The signin module provides the SigninRequest struct and its methods.
  • The upload module provides the Upload struct and its methods.
  • The workitem module provides the WorkItem struct and its methods.

Structs§

Enums§

  • Client enum, used to determine which client to use.
  • Client event enum, used to determine which event has occurred.
  • Error type for OpenIAP

Functions§