pub struct StorageBucketApi { /* private fields */ }Expand description
Implementations§
Source§impl StorageBucketApi
impl StorageBucketApi
Sourcepub async fn upload(
&self,
path: &str,
data: Vec<u8>,
options: FileOptions,
) -> Result<UploadResponse, StorageError>
pub async fn upload( &self, path: &str, data: Vec<u8>, options: FileOptions, ) -> Result<UploadResponse, StorageError>
Upload a file to the bucket.
Mirrors supabase.storage.from('bucket').upload(path, file, options).
Sourcepub async fn update(
&self,
path: &str,
data: Vec<u8>,
options: Option<FileOptions>,
) -> Result<UploadResponse, StorageError>
pub async fn update( &self, path: &str, data: Vec<u8>, options: Option<FileOptions>, ) -> Result<UploadResponse, StorageError>
Update (replace) a file in the bucket.
Mirrors supabase.storage.from('bucket').update(path, file, options).
Sourcepub async fn download(&self, path: &str) -> Result<Vec<u8>, StorageError>
pub async fn download(&self, path: &str) -> Result<Vec<u8>, StorageError>
Download a file from the bucket.
Returns the raw file bytes.
Sourcepub async fn list(
&self,
path: Option<&str>,
options: Option<SearchOptions>,
) -> Result<Vec<FileObject>, StorageError>
pub async fn list( &self, path: Option<&str>, options: Option<SearchOptions>, ) -> Result<Vec<FileObject>, StorageError>
List files in the bucket.
path is the folder prefix (e.g., "folder" or None for root).
Sourcepub async fn move_file(&self, from: &str, to: &str) -> Result<(), StorageError>
pub async fn move_file(&self, from: &str, to: &str) -> Result<(), StorageError>
Move a file within the bucket.
Mirrors supabase.storage.from('bucket').move(from, to).
Sourcepub async fn copy(&self, from: &str, to: &str) -> Result<String, StorageError>
pub async fn copy(&self, from: &str, to: &str) -> Result<String, StorageError>
Copy a file within the bucket.
Returns the key of the new file.
Sourcepub async fn remove(
&self,
paths: Vec<&str>,
) -> Result<Vec<FileObject>, StorageError>
pub async fn remove( &self, paths: Vec<&str>, ) -> Result<Vec<FileObject>, StorageError>
Remove files from the bucket.
Mirrors supabase.storage.from('bucket').remove([paths]).
Sourcepub async fn create_signed_url(
&self,
path: &str,
expires_in: u64,
) -> Result<SignedUrlResponse, StorageError>
pub async fn create_signed_url( &self, path: &str, expires_in: u64, ) -> Result<SignedUrlResponse, StorageError>
Create a signed URL for time-limited access to a file.
expires_in is the number of seconds until the URL expires.
Sourcepub async fn create_signed_urls(
&self,
paths: Vec<&str>,
expires_in: u64,
) -> Result<Vec<SignedUrlBatchEntry>, StorageError>
pub async fn create_signed_urls( &self, paths: Vec<&str>, expires_in: u64, ) -> Result<Vec<SignedUrlBatchEntry>, StorageError>
Create signed URLs for multiple files.
expires_in is the number of seconds until the URLs expire.
Sourcepub fn get_public_url(&self, path: &str) -> String
pub fn get_public_url(&self, path: &str) -> String
Get the public URL for a file (no HTTP call, just URL construction).
Only works for files in public buckets.
Sourcepub async fn create_signed_upload_url(
&self,
path: &str,
) -> Result<SignedUploadUrlResponse, StorageError>
pub async fn create_signed_upload_url( &self, path: &str, ) -> Result<SignedUploadUrlResponse, StorageError>
Create a signed upload URL for delegated uploads.
Sourcepub async fn upload_to_signed_url(
&self,
token: &str,
path: &str,
data: Vec<u8>,
options: Option<FileOptions>,
) -> Result<(), StorageError>
pub async fn upload_to_signed_url( &self, token: &str, path: &str, data: Vec<u8>, options: Option<FileOptions>, ) -> Result<(), StorageError>
Upload a file using a previously created signed upload URL.
Sourcepub async fn info(&self, path: &str) -> Result<FileInfo, StorageError>
pub async fn info(&self, path: &str) -> Result<FileInfo, StorageError>
Get file metadata.
Mirrors supabase.storage.from('bucket').info(path).
Sourcepub async fn exists(&self, path: &str) -> Result<bool, StorageError>
pub async fn exists(&self, path: &str) -> Result<bool, StorageError>
Check if a file exists.
Mirrors supabase.storage.from('bucket').exists(path).
Returns true if the file exists, false if it does not (404).
Sourcepub async fn download_with_transform(
&self,
path: &str,
transform: &TransformOptions,
) -> Result<Vec<u8>, StorageError>
pub async fn download_with_transform( &self, path: &str, transform: &TransformOptions, ) -> Result<Vec<u8>, StorageError>
Download with server-side image transformation.
Mirrors supabase.storage.from('bucket').download(path, { transform }).
Sourcepub fn get_public_url_with_transform(
&self,
path: &str,
transform: &TransformOptions,
) -> String
pub fn get_public_url_with_transform( &self, path: &str, transform: &TransformOptions, ) -> String
Get public URL with image transformation (no HTTP call).
Mirrors supabase.storage.from('bucket').getPublicUrl(path, { transform }).
Sourcepub async fn create_signed_url_with_transform(
&self,
path: &str,
expires_in: u64,
transform: &TransformOptions,
) -> Result<SignedUrlResponse, StorageError>
pub async fn create_signed_url_with_transform( &self, path: &str, expires_in: u64, transform: &TransformOptions, ) -> Result<SignedUrlResponse, StorageError>
Create a signed URL with image transformation.
Mirrors supabase.storage.from('bucket').createSignedUrl(path, expiresIn, { transform }).
Sourcepub async fn create_signed_urls_with_transform(
&self,
paths: Vec<&str>,
expires_in: u64,
transform: &TransformOptions,
) -> Result<Vec<SignedUrlBatchEntry>, StorageError>
pub async fn create_signed_urls_with_transform( &self, paths: Vec<&str>, expires_in: u64, transform: &TransformOptions, ) -> Result<Vec<SignedUrlBatchEntry>, StorageError>
Create batch signed URLs with image transformation.
Mirrors supabase.storage.from('bucket').createSignedUrls(paths, expiresIn, { transform }).
Sourcepub async fn move_to_bucket(
&self,
from: &str,
to_bucket: &str,
to_path: &str,
) -> Result<(), StorageError>
pub async fn move_to_bucket( &self, from: &str, to_bucket: &str, to_path: &str, ) -> Result<(), StorageError>
Move a file to a different bucket.
Mirrors supabase.storage.from('bucket').move(from, to, { destinationBucket }).
Sourcepub async fn copy_to_bucket(
&self,
from: &str,
to_bucket: &str,
to_path: &str,
) -> Result<String, StorageError>
pub async fn copy_to_bucket( &self, from: &str, to_bucket: &str, to_path: &str, ) -> Result<String, StorageError>
Copy a file to a different bucket.
Returns the key of the new file.
Mirrors supabase.storage.from('bucket').copy(from, to, { destinationBucket }).
Sourcepub fn get_public_url_with_download(
&self,
path: &str,
filename: Option<&str>,
) -> String
pub fn get_public_url_with_download( &self, path: &str, filename: Option<&str>, ) -> String
Get a public URL with optional download disposition.
When filename is Some("file.txt"), appends ?download=file.txt to the URL.
When filename is Some(""), appends ?download= (uses original filename).
Mirrors supabase.storage.from('bucket').getPublicUrl(path, { download }).
Sourcepub async fn create_signed_url_with_download(
&self,
path: &str,
expires_in: u64,
filename: Option<&str>,
) -> Result<SignedUrlResponse, StorageError>
pub async fn create_signed_url_with_download( &self, path: &str, expires_in: u64, filename: Option<&str>, ) -> Result<SignedUrlResponse, StorageError>
Create a signed URL with optional download disposition.
When filename is Some("file.txt"), appends &download=file.txt to the signed URL.
When filename is Some(""), appends &download= (uses original filename).
Mirrors supabase.storage.from('bucket').createSignedUrl(path, expiresIn, { download }).
Trait Implementations§
Source§impl Clone for StorageBucketApi
impl Clone for StorageBucketApi
Source§fn clone(&self) -> StorageBucketApi
fn clone(&self) -> StorageBucketApi
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more