[−][src]Struct algorithmia::data::DataFileItem
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]
B: Into<Body>,
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]
Auto Trait Implementations
impl Send for DataFileItem
impl Sync for DataFileItem
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Same for T
type Output = T
Should always be Self