pub struct FileUploadable {
pub name: String,
pub mimetype: String,
pub s3key: String,
}Expand description
File that can be uploaded to S3
Fields§
§name: StringFilename
mimetype: StringMIME type
s3key: StringS3 key after upload
Implementations§
Source§impl FileUploadable
impl FileUploadable
Sourcepub async fn from_path(
client: &ComposioClient,
file: &Path,
tool: &str,
toolkit: &str,
) -> Result<Self, ComposioError>
pub async fn from_path( client: &ComposioClient, file: &Path, tool: &str, toolkit: &str, ) -> Result<Self, ComposioError>
Create a FileUploadable from a local file path or public URL
If the file parameter is a URL (starts with http:// or https://), it will fetch the file content from the URL and upload it to S3. Otherwise, it treats it as a local file path.
§Arguments
client- The HTTP client for API callsfile- Local file path or public URLtool- The tool slugtoolkit- The toolkit slug
§Returns
FileUploadable instance with S3 key
§Errors
Returns error if file doesn’t exist, is not readable, or upload fails
Sourcepub async fn from_url(
client: &ComposioClient,
url: &str,
tool: &str,
toolkit: &str,
) -> Result<Self, ComposioError>
pub async fn from_url( client: &ComposioClient, url: &str, tool: &str, toolkit: &str, ) -> Result<Self, ComposioError>
Create a FileUploadable from a public URL
Trait Implementations§
Source§impl Clone for FileUploadable
impl Clone for FileUploadable
Source§fn clone(&self) -> FileUploadable
fn clone(&self) -> FileUploadable
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FileUploadable
impl Debug for FileUploadable
Source§impl<'de> Deserialize<'de> for FileUploadable
impl<'de> Deserialize<'de> for FileUploadable
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 FileUploadable
impl RefUnwindSafe for FileUploadable
impl Send for FileUploadable
impl Sync for FileUploadable
impl Unpin for FileUploadable
impl UnsafeUnpin for FileUploadable
impl UnwindSafe for FileUploadable
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