[−][src]Struct algorithmia::Algorithmia
The top-level struct for instantiating Algorithmia client endpoints
Methods
impl Algorithmia
[src]
pub fn new() -> Result<Algorithmia>
[src]
Instantiate a new client
The 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.
pub fn client<A: Into<String>>(api_key: A) -> Result<Algorithmia>
[src]
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");
pub fn client_with_url<A: Into<String>, U: IntoUrl>(
api_key: A,
base_url: U
) -> Result<Algorithmia>
[src]
api_key: A,
base_url: U
) -> Result<Algorithmia>
Instantiate a new client against alternate API servers
pub fn algo<A: Into<AlgoUri>>(&self, algorithm: A) -> Algorithm
[src]
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");
pub fn dir(&self, path: &str) -> DataDir
[src]
Instantiate a DataDirectory
from this client
Examples
use algorithmia::Algorithmia; let client = Algorithmia::client("111112222233333444445555566")?; let rustfoo = client.dir("data://.my/rustfoo");
pub fn file(&self, path: &str) -> DataFile
[src]
Instantiate a DataDirectory
from this client
Examples
use algorithmia::Algorithmia; let client = Algorithmia::client("111112222233333444445555566")?; let rustfoo = client.file("data://.my/rustfoo");
pub fn data(&self, path: &str) -> DataObject
[src]
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
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl Send for Algorithmia
impl Sync for Algorithmia
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Same for T
type Output = T
Should always be Self