pub struct FilesApi { /* private fields */ }
Expand description
Files API for managing file uploads.
Implementations§
Source§impl FilesApi
impl FilesApi
Sourcepub fn new(http: HttpClient) -> Self
pub fn new(http: HttpClient) -> Self
Create a new Files API instance.
Sourcepub async fn create_from_bytes(
&self,
file_content: &[u8],
filename: Option<&str>,
content_type: Option<&str>,
metadata: Option<&HashMap<String, Value>>,
) -> Result<File>
pub async fn create_from_bytes( &self, file_content: &[u8], filename: Option<&str>, content_type: Option<&str>, metadata: Option<&HashMap<String, Value>>, ) -> Result<File>
Upload a file from bytes with optional metadata.
Sourcepub async fn create_from_path(
&self,
file_path: &Path,
metadata: Option<&HashMap<String, Value>>,
) -> Result<File>
pub async fn create_from_path( &self, file_path: &Path, metadata: Option<&HashMap<String, Value>>, ) -> Result<File>
Upload a file from a local path.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FilesApi
impl !RefUnwindSafe for FilesApi
impl Send for FilesApi
impl Sync for FilesApi
impl Unpin for FilesApi
impl !UnwindSafe for FilesApi
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