pub struct FileStore { /* private fields */ }Expand description
OpenDAL-backed file storage for the proxy server.
Supports any OpenDAL backend (memory, S3, GCS, local filesystem, etc.)
through the FileStorageConfig backend configuration.
Implementations§
Source§impl FileStore
impl FileStore
Sourcepub fn from_config(config: &FileStorageConfig) -> Result<Self, String>
pub fn from_config(config: &FileStorageConfig) -> Result<Self, String>
Build a FileStore from proxy file storage configuration.
Parses the backend scheme from config.backend, builds an OpenDAL
operator with the provided backend_config, and stores config.prefix
for path prefixing.
§Errors
Returns an error string if the scheme is unknown or the operator cannot be constructed.
Sourcepub async fn write(&self, key: &str, data: Bytes) -> Result<(), String>
pub async fn write(&self, key: &str, data: Bytes) -> Result<(), String>
Write data to the store under the given key.
§Errors
Returns an error string if the write operation fails.
Sourcepub async fn read(&self, key: &str) -> Result<Bytes, String>
pub async fn read(&self, key: &str) -> Result<Bytes, String>
Read data from the store for the given key.
§Errors
Returns an error string if the key does not exist or the read fails.
Auto Trait Implementations§
impl Freeze for FileStore
impl !RefUnwindSafe for FileStore
impl Send for FileStore
impl Sync for FileStore
impl Unpin for FileStore
impl UnsafeUnpin for FileStore
impl !UnwindSafe for FileStore
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