[−][src]Struct algorithmia::data::DataFile
Algorithmia data file
Methods
impl DataFile
[src]
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 HasDataPath for DataFile
[src]
fn to_url(&self) -> Result<Url>
[src]
Get the API Endpoint URL for a particular data URI
fn to_data_uri(&self) -> String
[src]
Get the Algorithmia data URI a given Data Object Read more
fn parent(&self) -> Option<DataDir>
[src]
Get the parent off a given Data Object Read more
fn basename(&self) -> Option<String>
[src]
Get the basename from the Data Object's path (i.e. unix basename
) Read more
fn exists(&self) -> Result<bool>
[src]
Determine if a file or directory exists for a particular data URI Read more
impl From<DataObject> for DataFile
[src]
fn from(d: DataObject) -> Self
[src]
Auto Trait Implementations
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