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(NoAuth);
fn alt_client<A: Into<ApiAuth>>(base_url: Url, api_key: A) -> Algorithmia
Instantiate a new client against alternate API servers
fn algo<A: Into<AlgoRef>>(&self, algorithm: A) -> Algorithm
Instantiate an Algorithm
from this client
By using In
Examples
use algorithmia::Algorithmia; use algorithmia::algo::Version; let client = Algorithmia::client("111112222233333444445555566"); let factor = client.algo("anowell/Dijkstra/0.1"); let factor = client.algo(("anowell/Dijkstra", Version::Latest));
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) -> DataPath
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]
fn default() -> Algorithmia
Returns the "default value" for a type. Read more