[][src]Struct algorithmia::data::DataFileItem

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

DataFile wrapper with metadata

Fields

size: u64

Size of file in bytes

last_modified: DateTime<Utc>

Last modified timestamp

Methods from Deref<Target = DataFile>

pub fn put<B>(&self, body: B) -> Result<()> where
    B: Into<Body>, 
[src]

Write to the Algorithmia Data API

Examples

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

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

let file = File::open("/path/to/file.jpg")?;
client.file(".my/my_dir/file.jpg").put(file)?;

pub fn get(&self) -> Result<FileData>[src]

Get a file from the Algorithmia Data API

Examples

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

let data = my_file.get()?.into_string()?;

pub fn delete(&self) -> Result<()>[src]

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 DataFileItem[src]

type Target = DataFile

The resulting type after dereferencing.

Auto Trait Implementations

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Same for T

type Output = T

Should always be Self

impl<T> Erased for T