[−][src]Struct algorithmia::data::DataDirItem
DataDir
wrapper (currently no metadata)
Methods from Deref<Target = DataDir>
ⓘImportant traits for DirectoryListing<'a>pub fn list(&self) -> DirectoryListing
[src]
ⓘImportant traits for DirectoryListing<'a>
Display Directory details if it exists
Examples
let client = Algorithmia::client("111112222233333444445555566")?; let my_dir = client.dir(".my/my_dir"); let dir_list = my_dir.list(); for entry in dir_list { match entry { Ok(DataItem::File(f)) => println!("File: {}", f.to_data_uri()), Ok(DataItem::Dir(d)) => println!("Dir: {}", d.to_data_uri()), Err(err) => { println!("Error: {}", err); break; }, } };
pub fn create<Acl: Into<DataAcl>>(&self, acl: Acl) -> Result<()>
[src]
Create a Directory
Use DataAcl::default()
or the ReadAcl
enum to set the ACL
Examples
let client = Algorithmia::client("111112222233333444445555566")?; let my_dir = client.dir(".my/my_dir"); match my_dir.create(DataAcl::default()) { Ok(_) => println!("Successfully created Directory"), Err(e) => println!("Error created directory: {}", e), };
pub fn delete(&self, force: bool) -> Result<DirectoryDeleted>
[src]
Delete a Directory
Examples
let client = Algorithmia::client("111112222233333444445555566")?; let my_dir = client.dir(".my/my_dir"); match my_dir.delete(false) { Ok(_) => println!("Successfully deleted Directory"), Err(err) => println!("Error deleting directory: {}", err), };
pub fn put_file<P: AsRef<Path>>(&self, file_path: P) -> Result<()>
[src]
Upload a file to an existing Directory
Examples
let client = Algorithmia::client("111112222233333444445555566")?; let my_dir = client.dir(".my/my_dir"); match my_dir.put_file("/path/to/file") { Ok(_) => println!("Successfully uploaded to: {}", my_dir.to_data_uri()), Err(err) => println!("Error uploading file: {}", err), };
pub fn child<T: HasDataPath>(&self, filename: &str) -> T
[src]
Instantiate DataFile
or DataDir
as a child of this DataDir
Trait Implementations
impl Deref for DataDirItem
[src]
Auto Trait Implementations
impl Send for DataDirItem
impl Sync for DataDirItem
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