Struct algorithmia::data::DataObject [] [src]

pub struct DataObject { /* fields omitted */ }

Algorithmia data object (file or directory)

Methods

impl DataObject
[src]

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

let my_obj = client.data("data://.my/some/path");
match my_obj.get_type().ok().unwrap() {
    DataType::File => println!("{} is a file", my_obj.to_data_uri()),
    DataType::Dir => println!("{} is a directory", my_obj.to_data_uri()),
}

Determine if a data URI is for a file or directory and convert into the appropriate type

let my_obj = client.data("data://.my/some/path");
match my_obj.into_type().ok().unwrap() {
    DataItem::File(f) => println!("{} is a file", f.to_data_uri()),
    DataItem::Dir(d) => println!("{} is a directory", d.to_data_uri()),
}

Trait Implementations

impl HasDataPath for DataObject
[src]

Get the API Endpoint URL for a particular data URI

Get the Algorithmia data URI a given Data Object Read more

Get the parent off a given Data Object Read more

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

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