Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/aws/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ use crate::client::{GetOptionsExt, HttpClient, HttpError, HttpResponse};
use crate::list::{PaginatedListOptions, PaginatedListResult};
use crate::multipart::PartId;
use crate::{
Attribute, Attributes, ClientOptions, GetOptions, MultipartId, Path, PutMultipartOpts,
Attribute, Attributes, ClientOptions, GetOptions, MultipartId, Path, PutMultipartOptions,
PutPayload, PutResult, Result, RetryConfig, TagSet,
};
use async_trait::async_trait;
Expand Down Expand Up @@ -630,9 +630,9 @@ impl S3Client {
pub(crate) async fn create_multipart(
&self,
location: &Path,
opts: PutMultipartOpts,
opts: PutMultipartOptions,
) -> Result<MultipartId> {
let PutMultipartOpts {
let PutMultipartOptions {
tags,
attributes,
extensions,
Expand Down
12 changes: 6 additions & 6 deletions src/aws/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ use crate::signer::Signer;
use crate::util::STRICT_ENCODE_SET;
use crate::{
Error, GetOptions, GetResult, ListResult, MultipartId, MultipartUpload, ObjectMeta,
ObjectStore, Path, PutMode, PutMultipartOpts, PutOptions, PutPayload, PutResult, Result,
ObjectStore, Path, PutMode, PutMultipartOptions, PutOptions, PutPayload, PutResult, Result,
UploadPart,
};

Expand Down Expand Up @@ -231,7 +231,7 @@ impl ObjectStore for AmazonS3 {
async fn put_multipart_opts(
&self,
location: &Path,
opts: PutMultipartOpts,
opts: PutMultipartOptions,
) -> Result<Box<dyn MultipartUpload>> {
let upload_id = self.client.create_multipart(location, opts).await?;

Expand Down Expand Up @@ -317,7 +317,7 @@ impl ObjectStore for AmazonS3 {
Some(S3CopyIfNotExists::Multipart) => {
let upload_id = self
.client
.create_multipart(to, PutMultipartOpts::default())
.create_multipart(to, PutMultipartOptions::default())
.await?;

let res = async {
Expand Down Expand Up @@ -442,7 +442,7 @@ impl MultipartUpload for S3MultiPartUpload {
impl MultipartStore for AmazonS3 {
async fn create_multipart(&self, path: &Path) -> Result<MultipartId> {
self.client
.create_multipart(path, PutMultipartOpts::default())
.create_multipart(path, PutMultipartOptions::default())
.await
}

Expand Down Expand Up @@ -518,7 +518,7 @@ mod tests {

let str = "test.bin";
let path = Path::parse(str).unwrap();
let opts = PutMultipartOpts::default();
let opts = PutMultipartOptions::default();
let mut upload = store.put_multipart_opts(&path, opts).await.unwrap();

upload
Expand Down Expand Up @@ -549,7 +549,7 @@ mod tests {

let str = "test.bin";
let path = Path::parse(str).unwrap();
let opts = PutMultipartOpts::default();
let opts = PutMultipartOptions::default();
let mut upload = store.put_multipart_opts(&path, opts).await.unwrap();

upload
Expand Down
6 changes: 3 additions & 3 deletions src/azure/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use crate::multipart::PartId;
use crate::util::{deserialize_rfc1123, GetRange};
use crate::{
Attribute, Attributes, ClientOptions, GetOptions, ListResult, ObjectMeta, Path, PutMode,
PutMultipartOpts, PutOptions, PutPayload, PutResult, Result, RetryConfig, TagSet,
PutMultipartOptions, PutOptions, PutPayload, PutResult, Result, RetryConfig, TagSet,
};
use async_trait::async_trait;
use base64::prelude::{BASE64_STANDARD, BASE64_STANDARD_NO_PAD};
Expand Down Expand Up @@ -597,9 +597,9 @@ impl AzureClient {
&self,
path: &Path,
parts: Vec<PartId>,
opts: PutMultipartOpts,
opts: PutMultipartOptions,
) -> Result<PutResult> {
let PutMultipartOpts {
let PutMultipartOptions {
tags,
attributes,
extensions,
Expand Down
6 changes: 3 additions & 3 deletions src/azure/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use crate::{
path::Path,
signer::Signer,
GetOptions, GetResult, ListResult, MultipartId, MultipartUpload, ObjectMeta, ObjectStore,
PutMultipartOpts, PutOptions, PutPayload, PutResult, Result, UploadPart,
PutMultipartOptions, PutOptions, PutPayload, PutResult, Result, UploadPart,
};
use async_trait::async_trait;
use futures::stream::{BoxStream, StreamExt, TryStreamExt};
Expand Down Expand Up @@ -99,7 +99,7 @@ impl ObjectStore for MicrosoftAzure {
async fn put_multipart_opts(
&self,
location: &Path,
opts: PutMultipartOpts,
opts: PutMultipartOptions,
) -> Result<Box<dyn MultipartUpload>> {
Ok(Box::new(AzureMultiPartUpload {
part_idx: 0,
Expand Down Expand Up @@ -221,7 +221,7 @@ impl Signer for MicrosoftAzure {
struct AzureMultiPartUpload {
part_idx: usize,
state: Arc<UploadState>,
opts: PutMultipartOpts,
opts: PutMultipartOptions,
}

#[derive(Debug)]
Expand Down
6 changes: 3 additions & 3 deletions src/buffered.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

use crate::path::Path;
use crate::{
Attributes, ObjectMeta, ObjectStore, PutMultipartOpts, PutOptions, PutPayloadMut, TagSet,
Attributes, ObjectMeta, ObjectStore, PutMultipartOptions, PutOptions, PutPayloadMut, TagSet,
WriteMultipart,
};
use bytes::Bytes;
Expand Down Expand Up @@ -337,7 +337,7 @@ impl BufWriter {
} else {
let buffer = std::mem::take(b);
let path = std::mem::take(path);
let opts = PutMultipartOpts {
let opts = PutMultipartOptions {
attributes: self.attributes.take().unwrap_or_default(),
tags: self.tags.take().unwrap_or_default(),
extensions: self.extensions.take().unwrap_or_default(),
Expand Down Expand Up @@ -397,7 +397,7 @@ impl AsyncWrite for BufWriter {
if b.content_length().saturating_add(buf.len()) >= cap {
let buffer = std::mem::take(b);
let path = std::mem::take(path);
let opts = PutMultipartOpts {
let opts = PutMultipartOptions {
attributes: self.attributes.take().unwrap_or_default(),
tags: self.tags.take().unwrap_or_default(),
extensions: self.extensions.take().unwrap_or_default(),
Expand Down
4 changes: 2 additions & 2 deletions src/chunked.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use futures::StreamExt;
use crate::path::Path;
use crate::{
GetOptions, GetResult, GetResultPayload, ListResult, MultipartUpload, ObjectMeta, ObjectStore,
PutMultipartOpts, PutOptions, PutResult,
PutMultipartOptions, PutOptions, PutResult,
};
use crate::{PutPayload, Result};

Expand Down Expand Up @@ -78,7 +78,7 @@ impl ObjectStore for ChunkedStore {
async fn put_multipart_opts(
&self,
location: &Path,
opts: PutMultipartOpts,
opts: PutMultipartOptions,
) -> Result<Box<dyn MultipartUpload>> {
self.inner.put_multipart_opts(location, opts).await
}
Expand Down
6 changes: 3 additions & 3 deletions src/gcp/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use crate::multipart::PartId;
use crate::path::Path;
use crate::util::hex_encode;
use crate::{
Attribute, Attributes, ClientOptions, GetOptions, MultipartId, PutMode, PutMultipartOpts,
Attribute, Attributes, ClientOptions, GetOptions, MultipartId, PutMode, PutMultipartOptions,
PutOptions, PutPayload, PutResult, Result, RetryConfig,
};
use async_trait::async_trait;
Expand Down Expand Up @@ -444,9 +444,9 @@ impl GoogleCloudStorageClient {
pub(crate) async fn multipart_initiate(
&self,
path: &Path,
opts: PutMultipartOpts,
opts: PutMultipartOptions,
) -> Result<MultipartId> {
let PutMultipartOpts {
let PutMultipartOptions {
// not supported by GCP
tags: _,
attributes,
Expand Down
6 changes: 3 additions & 3 deletions src/gcp/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ use crate::gcp::credential::GCSAuthorizer;
use crate::signer::Signer;
use crate::{
multipart::PartId, path::Path, GetOptions, GetResult, ListResult, MultipartId, MultipartUpload,
ObjectMeta, ObjectStore, PutMultipartOpts, PutOptions, PutPayload, PutResult, Result,
ObjectMeta, ObjectStore, PutMultipartOptions, PutOptions, PutPayload, PutResult, Result,
UploadPart,
};
use async_trait::async_trait;
Expand Down Expand Up @@ -161,7 +161,7 @@ impl ObjectStore for GoogleCloudStorage {
async fn put_multipart_opts(
&self,
location: &Path,
opts: PutMultipartOpts,
opts: PutMultipartOptions,
) -> Result<Box<dyn MultipartUpload>> {
let upload_id = self.client.multipart_initiate(location, opts).await?;

Expand Down Expand Up @@ -213,7 +213,7 @@ impl ObjectStore for GoogleCloudStorage {
impl MultipartStore for GoogleCloudStorage {
async fn create_multipart(&self, path: &Path) -> Result<MultipartId> {
self.client
.multipart_initiate(path, PutMultipartOpts::default())
.multipart_initiate(path, PutMultipartOptions::default())
.await
}

Expand Down
5 changes: 3 additions & 2 deletions src/http/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ use crate::http::client::Client;
use crate::path::Path;
use crate::{
ClientConfigKey, ClientOptions, GetOptions, GetResult, ListResult, MultipartUpload, ObjectMeta,
ObjectStore, PutMode, PutMultipartOpts, PutOptions, PutPayload, PutResult, Result, RetryConfig,
ObjectStore, PutMode, PutMultipartOptions, PutOptions, PutPayload, PutResult, Result,
RetryConfig,
};

mod client;
Expand Down Expand Up @@ -122,7 +123,7 @@ impl ObjectStore for HttpStore {
async fn put_multipart_opts(
&self,
_location: &Path,
_opts: PutMultipartOpts,
_opts: PutMultipartOptions,
) -> Result<Box<dyn MultipartUpload>> {
Err(crate::Error::NotImplemented)
}
Expand Down
21 changes: 13 additions & 8 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ pub trait ObjectStore: std::fmt::Display + Send + Sync + Debug + 'static {
///
/// For more advanced multipart uploads see [`MultipartStore`](multipart::MultipartStore)
async fn put_multipart(&self, location: &Path) -> Result<Box<dyn MultipartUpload>> {
self.put_multipart_opts(location, PutMultipartOpts::default())
self.put_multipart_opts(location, PutMultipartOptions::default())
.await
}

Expand All @@ -627,7 +627,7 @@ pub trait ObjectStore: std::fmt::Display + Send + Sync + Debug + 'static {
async fn put_multipart_opts(
&self,
location: &Path,
opts: PutMultipartOpts,
opts: PutMultipartOptions,
) -> Result<Box<dyn MultipartUpload>>;

/// Return the bytes that are stored at the specified location.
Expand Down Expand Up @@ -823,7 +823,7 @@ macro_rules! as_ref_impl {
async fn put_multipart_opts(
&self,
location: &Path,
opts: PutMultipartOpts,
opts: PutMultipartOptions,
) -> Result<Box<dyn MultipartUpload>> {
self.as_ref().put_multipart_opts(location, opts).await
}
Expand Down Expand Up @@ -1234,9 +1234,14 @@ impl From<Attributes> for PutOptions {
}
}

// See <https://github.com/apache/arrow-rs-object-store/issues/339>.
#[doc(hidden)]
#[deprecated(note = "Use PutMultipartOptions", since = "0.13.0")]
pub type PutMultipartOpts = PutMultipartOptions;

/// Options for [`ObjectStore::put_multipart_opts`]
#[derive(Debug, Clone, Default)]
pub struct PutMultipartOpts {
pub struct PutMultipartOptions {
/// Provide a [`TagSet`] for this object
///
/// Implementations that don't support object tagging should ignore this
Expand All @@ -1254,7 +1259,7 @@ pub struct PutMultipartOpts {
pub extensions: ::http::Extensions,
}

impl PartialEq<Self> for PutMultipartOpts {
impl PartialEq<Self> for PutMultipartOptions {
fn eq(&self, other: &Self) -> bool {
let Self {
tags,
Expand All @@ -1270,9 +1275,9 @@ impl PartialEq<Self> for PutMultipartOpts {
}
}

impl Eq for PutMultipartOpts {}
impl Eq for PutMultipartOptions {}

impl From<TagSet> for PutMultipartOpts {
impl From<TagSet> for PutMultipartOptions {
fn from(tags: TagSet) -> Self {
Self {
tags,
Expand All @@ -1281,7 +1286,7 @@ impl From<TagSet> for PutMultipartOpts {
}
}

impl From<Attributes> for PutMultipartOpts {
impl From<Attributes> for PutMultipartOptions {
fn from(attributes: Attributes) -> Self {
Self {
attributes,
Expand Down
4 changes: 2 additions & 2 deletions src/limit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

use crate::{
BoxStream, GetOptions, GetResult, GetResultPayload, ListResult, MultipartUpload, ObjectMeta,
ObjectStore, Path, PutMultipartOpts, PutOptions, PutPayload, PutResult, Result, StreamExt,
ObjectStore, Path, PutMultipartOptions, PutOptions, PutPayload, PutResult, Result, StreamExt,
UploadPart,
};
use async_trait::async_trait;
Expand Down Expand Up @@ -96,7 +96,7 @@ impl<T: ObjectStore> ObjectStore for LimitStore<T> {
async fn put_multipart_opts(
&self,
location: &Path,
opts: PutMultipartOpts,
opts: PutMultipartOptions,
) -> Result<Box<dyn MultipartUpload>> {
let upload = self.inner.put_multipart_opts(location, opts).await?;
Ok(Box::new(LimitUpload {
Expand Down
5 changes: 3 additions & 2 deletions src/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ use crate::{
path::{absolute_path_to_url, Path},
util::InvalidGetRange,
Attributes, GetOptions, GetResult, GetResultPayload, ListResult, MultipartUpload, ObjectMeta,
ObjectStore, PutMode, PutMultipartOpts, PutOptions, PutPayload, PutResult, Result, UploadPart,
ObjectStore, PutMode, PutMultipartOptions, PutOptions, PutPayload, PutResult, Result,
UploadPart,
};

/// A specialized `Error` for filesystem object store-related errors
Expand Down Expand Up @@ -388,7 +389,7 @@ impl ObjectStore for LocalFileSystem {
async fn put_multipart_opts(
&self,
location: &Path,
opts: PutMultipartOpts,
opts: PutMultipartOptions,
) -> Result<Box<dyn MultipartUpload>> {
if !opts.attributes.is_empty() {
return Err(crate::Error::NotImplemented);
Expand Down
4 changes: 2 additions & 2 deletions src/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use crate::multipart::{MultipartStore, PartId};
use crate::util::InvalidGetRange;
use crate::{
path::Path, Attributes, GetRange, GetResult, GetResultPayload, ListResult, MultipartId,
MultipartUpload, ObjectMeta, ObjectStore, PutMode, PutMultipartOpts, PutOptions, PutResult,
MultipartUpload, ObjectMeta, ObjectStore, PutMode, PutMultipartOptions, PutOptions, PutResult,
Result, UpdateVersion, UploadPart,
};
use crate::{GetOptions, PutPayload};
Expand Down Expand Up @@ -224,7 +224,7 @@ impl ObjectStore for InMemory {
async fn put_multipart_opts(
&self,
location: &Path,
opts: PutMultipartOpts,
opts: PutMultipartOptions,
) -> Result<Box<dyn MultipartUpload>> {
Ok(Box::new(InMemoryUpload {
location: location.clone(),
Expand Down
6 changes: 3 additions & 3 deletions src/prefix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ use std::ops::Range;

use crate::path::Path;
use crate::{
GetOptions, GetResult, ListResult, MultipartUpload, ObjectMeta, ObjectStore, PutMultipartOpts,
PutOptions, PutPayload, PutResult, Result,
GetOptions, GetResult, ListResult, MultipartUpload, ObjectMeta, ObjectStore,
PutMultipartOptions, PutOptions, PutPayload, PutResult, Result,
};

/// Store wrapper that applies a constant prefix to all paths handled by the store.
Expand Down Expand Up @@ -121,7 +121,7 @@ impl<T: ObjectStore> ObjectStore for PrefixStore<T> {
async fn put_multipart_opts(
&self,
location: &Path,
opts: PutMultipartOpts,
opts: PutMultipartOptions,
) -> Result<Box<dyn MultipartUpload>> {
let full_path = self.full_path(location);
self.inner.put_multipart_opts(&full_path, opts).await
Expand Down
Loading