Struct algorithmia::data::DataObject
[−]
[src]
pub struct DataObject { /* fields omitted */ }
Algorithmia data object (file or directory)
Methods
impl DataObject
[src]
fn get_type(&self) -> Result<DataType>
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()), }
fn into_type(self) -> Result<DataItem>
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]
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 Read more
fn parent(&self) -> Option<DataDir>
Get the parent off a given Data Object Read more
fn basename(&self) -> Option<String>
Get the basename from the Data Object's path (i.e. unix basename
) Read more
fn exists(&self) -> Result<bool>
Determine if a file or directory exists for a particular data URI Read more