Struct algorithmia::Algorithmia
[−]
[src]
pub struct Algorithmia { /* fields omitted */ }
The top-level struct for instantiating Algorithmia client endpoints
Methods
impl<'a, 'c> Algorithmia
[src]
fn client<A: Into<ApiAuth>>(api_key: A) -> Algorithmia
Instantiate a new client
Client should be instatiated with your API key, except when running within an algorithm on the Algorithmia platform.
Examples
use algorithmia::*; // Initialize a client let client = Algorithmia::client("simUseYourApiKey"); // Initialize a client (for algorithms running on the Algorithmia platform) let client = Algorithmia::client(ApiAuth::None);
fn client_with_url<A: Into<ApiAuth>, U: IntoUrl>(
base_url: U,
api_key: A
) -> Algorithmia
base_url: U,
api_key: A
) -> Algorithmia
Instantiate a new client against alternate API servers
fn algo<A: Into<AlgoUri>>(&self, algorithm: A) -> Algorithm
Instantiate an Algorithm
from this client
By using In
Examples
use algorithmia::Algorithmia; let client = Algorithmia::client("111112222233333444445555566"); let factor = client.algo("anowell/Dijkstra/0.1");
fn dir(&self, path: &'a str) -> DataDir
Instantiate a DataDirectory
from this client
Examples
use algorithmia::Algorithmia; let client = Algorithmia::client("111112222233333444445555566"); let rustfoo = client.dir("data://.my/rustfoo");
fn file(&self, path: &'a str) -> DataFile
Instantiate a DataDirectory
from this client
Examples
use algorithmia::Algorithmia; let client = Algorithmia::client("111112222233333444445555566"); let rustfoo = client.file("data://.my/rustfoo");
fn data(&self, path: &'a str) -> DataObject
Instantiate a DataPath
from this client
Use this if you don't explicitly know if a Data URI is to a directory or file
Examples
use algorithmia::Algorithmia; let client = Algorithmia::client("111112222233333444445555566"); let rustfoo = client.data("data://.my/rustfoo/what_am_i");
Trait Implementations
impl Clone for Algorithmia
[src]
Allow cloning in order to reuse http client (and API key) for multiple connections
fn clone(&self) -> Algorithmia
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Default for Algorithmia
[src]
The default Algorithmia client uses environment variables
ALGORITHMIA_API
to override the default base URL of the API
and ALGORITHMIA_API_KEY
to optionally the API key.
fn default() -> Algorithmia
Returns the "default value" for a type. Read more