mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-18 18:46:17 +00:00
refactor: remove ecstore operation compat facades (#3608)
This commit is contained in:
@@ -0,0 +1,105 @@
|
||||
use crate::error::Error;
|
||||
use crate::object_api::{GetObjectReader, ObjectInfo, ObjectOptions, PutObjReader};
|
||||
use rustfs_filemeta::FileInfo;
|
||||
use rustfs_storage_api::{
|
||||
DeletedObject, HTTPRangeSpec, ListObjectVersionsInfo as StorageListObjectVersionsInfo,
|
||||
ListObjectsV2Info as StorageListObjectsV2Info, ObjectInfoOrErr as StorageObjectInfoOrErr, ObjectToDelete,
|
||||
WalkOptions as StorageWalkOptions,
|
||||
};
|
||||
use std::fmt::Debug;
|
||||
use tokio_util::sync::CancellationToken;
|
||||
|
||||
type ListObjectsV2Info = StorageListObjectsV2Info<ObjectInfo>;
|
||||
type ListObjectVersionsInfo = StorageListObjectVersionsInfo<ObjectInfo>;
|
||||
type ObjectInfoOrErr = StorageObjectInfoOrErr<ObjectInfo, Error>;
|
||||
type WalkOptions = StorageWalkOptions<fn(&FileInfo) -> bool>;
|
||||
|
||||
pub(crate) trait EcstoreObjectIO:
|
||||
rustfs_storage_api::ObjectIO<
|
||||
Error = Error,
|
||||
RangeSpec = HTTPRangeSpec,
|
||||
HeaderMap = http::HeaderMap,
|
||||
ObjectOptions = ObjectOptions,
|
||||
ObjectInfo = ObjectInfo,
|
||||
GetObjectReader = GetObjectReader,
|
||||
PutObjectReader = PutObjReader,
|
||||
> + Send
|
||||
+ Sync
|
||||
+ Debug
|
||||
+ 'static
|
||||
{
|
||||
}
|
||||
|
||||
impl<T> EcstoreObjectIO for T where
|
||||
T: rustfs_storage_api::ObjectIO<
|
||||
Error = Error,
|
||||
RangeSpec = HTTPRangeSpec,
|
||||
HeaderMap = http::HeaderMap,
|
||||
ObjectOptions = ObjectOptions,
|
||||
ObjectInfo = ObjectInfo,
|
||||
GetObjectReader = GetObjectReader,
|
||||
PutObjectReader = PutObjReader,
|
||||
> + Send
|
||||
+ Sync
|
||||
+ Debug
|
||||
+ 'static
|
||||
{
|
||||
}
|
||||
|
||||
pub(crate) trait EcstoreObjectOperations:
|
||||
rustfs_storage_api::ObjectOperations<
|
||||
Error = Error,
|
||||
ObjectInfo = ObjectInfo,
|
||||
ObjectOptions = ObjectOptions,
|
||||
FileInfo = FileInfo,
|
||||
ObjectToDelete = ObjectToDelete,
|
||||
DeletedObject = DeletedObject,
|
||||
> + Send
|
||||
+ Sync
|
||||
+ Debug
|
||||
{
|
||||
}
|
||||
|
||||
impl<T> EcstoreObjectOperations for T where
|
||||
T: rustfs_storage_api::ObjectOperations<
|
||||
Error = Error,
|
||||
ObjectInfo = ObjectInfo,
|
||||
ObjectOptions = ObjectOptions,
|
||||
FileInfo = FileInfo,
|
||||
ObjectToDelete = ObjectToDelete,
|
||||
DeletedObject = DeletedObject,
|
||||
> + Send
|
||||
+ Sync
|
||||
+ Debug
|
||||
{
|
||||
}
|
||||
|
||||
pub(crate) trait EcstoreListOperations:
|
||||
rustfs_storage_api::ListOperations<
|
||||
Error = Error,
|
||||
ListObjectsV2Info = ListObjectsV2Info,
|
||||
ListObjectVersionsInfo = ListObjectVersionsInfo,
|
||||
ObjectInfoOrErr = ObjectInfoOrErr,
|
||||
WalkOptions = WalkOptions,
|
||||
WalkCancellation = CancellationToken,
|
||||
WalkResultSender = tokio::sync::mpsc::Sender<ObjectInfoOrErr>,
|
||||
> + Send
|
||||
+ Sync
|
||||
+ Debug
|
||||
{
|
||||
}
|
||||
|
||||
impl<T> EcstoreListOperations for T where
|
||||
T: rustfs_storage_api::ListOperations<
|
||||
Error = Error,
|
||||
ListObjectsV2Info = ListObjectsV2Info,
|
||||
ListObjectVersionsInfo = ListObjectVersionsInfo,
|
||||
ObjectInfoOrErr = ObjectInfoOrErr,
|
||||
WalkOptions = WalkOptions,
|
||||
WalkCancellation = CancellationToken,
|
||||
WalkResultSender = tokio::sync::mpsc::Sender<ObjectInfoOrErr>,
|
||||
> + Send
|
||||
+ Sync
|
||||
+ Debug
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user