pub struct Folder {Show 21 fields
pub id: u64,
pub name: Option<String>,
pub full_name: Option<String>,
pub context_id: Option<u64>,
pub context_type: Option<String>,
pub parent_folder_id: Option<u64>,
pub created_at: Option<DateTime<Utc>>,
pub updated_at: Option<DateTime<Utc>>,
pub lock_at: Option<DateTime<Utc>>,
pub unlock_at: Option<DateTime<Utc>>,
pub position: Option<u64>,
pub locked: Option<bool>,
pub folders_url: Option<String>,
pub files_url: Option<String>,
pub files_count: Option<u64>,
pub folders_count: Option<u64>,
pub hidden: Option<bool>,
pub locked_for_user: Option<bool>,
pub hidden_for_user: Option<bool>,
pub for_submissions: Option<bool>,
pub can_upload: Option<bool>,
/* private fields */
}Expand description
A folder in the Canvas file storage system.
Fields§
§id: u64§name: Option<String>§full_name: Option<String>§context_id: Option<u64>§context_type: Option<String>§parent_folder_id: Option<u64>§created_at: Option<DateTime<Utc>>§updated_at: Option<DateTime<Utc>>§lock_at: Option<DateTime<Utc>>§unlock_at: Option<DateTime<Utc>>§position: Option<u64>§locked: Option<bool>§folders_url: Option<String>§files_url: Option<String>§files_count: Option<u64>§folders_count: Option<u64>§locked_for_user: Option<bool>§for_submissions: Option<bool>§can_upload: Option<bool>Implementations§
Source§impl Folder
impl Folder
Sourcepub async fn update(&self, params: UpdateFolderParams) -> Result<Folder>
pub async fn update(&self, params: UpdateFolderParams) -> Result<Folder>
Sourcepub fn get_files(&self) -> PageStream<File>
pub fn get_files(&self) -> PageStream<File>
Sourcepub fn get_folders(&self) -> PageStream<Folder>
pub fn get_folders(&self) -> PageStream<Folder>
Sourcepub async fn create_folder(&self, name: &str) -> Result<Folder>
pub async fn create_folder(&self, name: &str) -> Result<Folder>
Sourcepub async fn upload_file(
&self,
request: UploadRequest,
data: Vec<u8>,
) -> Result<File>
pub async fn upload_file( &self, request: UploadRequest, data: Vec<u8>, ) -> Result<File>
Upload a file to this folder.
Canvas uses a two-step upload: first POSTing metadata to obtain an upload URL, then POSTing the file as multipart form data to that URL.
§Canvas API
POST /api/v1/folders/:id/files
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Folder
impl<'de> Deserialize<'de> for Folder
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Folder
impl !RefUnwindSafe for Folder
impl Send for Folder
impl Sync for Folder
impl Unpin for Folder
impl UnsafeUnpin for Folder
impl !UnwindSafe for Folder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more