Struct algorithmia::data::dir::DataFileEntry [] [src]

pub struct DataFileEntry {
    pub size: u64,
    pub last_modified: DateTime<UTC>,
    // some fields omitted
}

Fields

Methods from Deref<Target=DataFile>

Write to the Algorithmia Data API

Examples

let client = Algorithmia::client("111112222233333444445555566");

client.clone().file(".my/my_dir/string.txt").put("file_contents");
client.clone().file(".my/my_dir/bytes.txt").put("file_contents".as_bytes());

let mut stdin = io::stdin();
let data_file = client.clone().file(".my/my_dir/stdin.txt");
data_file.put(&mut stdin);

Get a file from the Algorithmia Data API

Examples

let client = Algorithmia::client("111112222233333444445555566");
let my_file = client.file(".my/my_dir/sample.txt");

match my_file.get() {
  Ok(mut response) => {
    let mut data = String::new();
    match response.read_to_string(&mut data) {
      Ok(_) => println!("{}", data),
      Err(err) => println!("IOError: {}", err),
    }
  },
  Err(err) => println!("Error downloading file: {}", err),
};

Delete a file from from the Algorithmia Data API

Examples

let client = Algorithmia::client("111112222233333444445555566");
let my_file = client.file(".my/my_dir/sample.txt");

match my_file.delete() {
  Ok(_) => println!("Successfully deleted file"),
  Err(err) => println!("Error deleting file: {}", err),
};

Trait Implementations

impl Deref for DataFileEntry
[src]

The resulting type after dereferencing

The method called to dereference a value