Struct raystack::SkySparkClient[][src]

pub struct SkySparkClient { /* fields omitted */ }
Expand description

A client for interacting with a SkySpark server.

Implementations

Create a new SkySparkClient.

Example

use raystack::{ClientSeed, SkySparkClient};
use url::Url;
let timeout_in_seconds = 30;
let client_seed = ClientSeed::new(timeout_in_seconds).unwrap();
let url = Url::parse("https://skyspark.company.com/api/bigProject/").unwrap();
let mut client = SkySparkClient::new(url, "username", "p4ssw0rd", client_seed).await.unwrap();

If creating multiple SkySparkClients, the same ClientSeed should be used for each. For example:

use raystack::{ClientSeed, SkySparkClient};
use url::Url;
let client_seed = ClientSeed::new(30).unwrap();
let url1 = Url::parse("http://test.com/api/bigProject/").unwrap();
let client1 = SkySparkClient::new(url1, "name", "p4ssw0rd", client_seed.clone()).await.unwrap();
let url2 = Url::parse("http://test.com/api/smallProj/").unwrap();
let client2 = SkySparkClient::new(url2, "name", "p4ss", client_seed.clone()).await.unwrap();

We pass in the ClientSeed struct because the underlying crypto library recommends that an application should create a single random number generator and use it for all randomness generation. Additionally, the underlying HTTP library recommends using a single copy of its HTTP client. These two resources are wrapped by this ClientSeed struct.

Return the project name for this client.

Return the project API url being used by this client.

Returns a grid containing basic server information.

Returns a grid describing what MIME types are available.

Returns a grid of history data for a single point.

Writes boolean values to a single point.

Writes numeric values to a single point. unit must be a valid Haystack unit literal, such as L/s or celsius.

Writes string values to a single point.

Writes boolean values with UTC timestamps to a single point. time_zone_name must be a valid SkySpark timezone name.

Writes numeric values with UTC timestamps to a single point. unit must be a valid Haystack unit literal, such as L/s or celsius. time_zone_name must be a valid SkySpark timezone name.

Writes string values with UTC timestamps to a single point. time_zone_name must be a valid SkySpark timezone name.

The Haystack nav operation.

Returns a grid containing the operations available on the server.

Returns a grid containing the records matching the given Axon filter string.

Returns a grid containing the records matching the given id Refs.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.