[][src]Trait algorithmia::data::HasDataPath

pub trait HasDataPath {
    fn to_url(&self) -> Result<Url> { ... }
fn to_data_uri(&self) -> String { ... }
fn parent(&self) -> Option<DataDir> { ... }
fn basename(&self) -> Option<String> { ... }
fn exists(&self) -> Result<bool> { ... } }

Trait used for types that can be represented with an Algorithmia Data URI

Provided methods

fn to_url(&self) -> Result<Url>

Get the API Endpoint URL for a particular data URI

fn to_data_uri(&self) -> String

Get the Algorithmia data URI a given Data Object

let my_dir = client.dir(".my/my_dir");
assert_eq!(my_dir.to_data_uri(), "data://.my/my_dir");

fn parent(&self) -> Option<DataDir>

Get the parent off a given Data Object

let my_file = client.file("data://.my/my_dir/my_file");
assert_eq!(my_file.parent().unwrap().to_data_uri(), "data://.my/my_dir");

fn basename(&self) -> Option<String>

Get the basename from the Data Object's path (i.e. unix basename)

let my_dir = client.dir("data:///.my/my_dir");
assert_eq!(my_dir.basename().unwrap(), "my_dir");

fn exists(&self) -> Result<bool>

Determine if a file or directory exists for a particular data URI

let my_file = client.data("data://.my/my_dir/my_file");
assert_eq!(my_file.exists().unwrap(), true);
Loading content...

Implementors

impl HasDataPath for DataDir[src]

fn to_url(&self) -> Result<Url>[src]

fn to_data_uri(&self) -> String[src]

fn parent(&self) -> Option<DataDir>[src]

fn basename(&self) -> Option<String>[src]

fn exists(&self) -> Result<bool>[src]

impl HasDataPath for DataFile[src]

fn to_url(&self) -> Result<Url>[src]

fn to_data_uri(&self) -> String[src]

fn parent(&self) -> Option<DataDir>[src]

fn basename(&self) -> Option<String>[src]

fn exists(&self) -> Result<bool>[src]

impl HasDataPath for DataObject[src]

fn to_url(&self) -> Result<Url>[src]

fn to_data_uri(&self) -> String[src]

fn parent(&self) -> Option<DataDir>[src]

fn basename(&self) -> Option<String>[src]

fn exists(&self) -> Result<bool>[src]

Loading content...