Skip to content

Commit 1a9758b

Browse files
alambkylebarron
andauthored
Improve Documentation on ObjectStoreExt (#551)
* Improve Documentation on `ObjectStoreExt` * Apply suggestions from code review Co-authored-by: Kyle Barron <kylebarron2@gmail.com> * Hedge wording for default implementaitons * revert changes to object store docs --------- Co-authored-by: Kyle Barron <kylebarron2@gmail.com>
1 parent e00ff79 commit 1a9758b

File tree

1 file changed

+29
-8
lines changed

1 file changed

+29
-8
lines changed

src/lib.rs

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@
6262
//! [ACID]: https://en.wikipedia.org/wiki/ACID
6363
//! [S3]: https://aws.amazon.com/s3/
6464
//!
65+
//! # APIs
66+
//!
67+
//! * [`ObjectStore`]: Core object store API
68+
//! * [`ObjectStoreExt`]: (*New in 0.13.0*) Extension trait with additional convenience methods
69+
//!
6570
//! # Available [`ObjectStore`] Implementations
6671
//!
6772
//! By default, this crate provides the following implementations:
@@ -613,18 +618,32 @@ pub type DynObjectStore = dyn ObjectStore;
613618
/// Id type for multipart uploads.
614619
pub type MultipartId = String;
615620

616-
/// Universal API to multiple object store services.
621+
/// Universal API for object store services.
617622
///
618-
/// For more convenience methods, check [`ObjectStoreExt`].
623+
/// See the [module-level documentation](crate) for a high level overview and
624+
/// examples. See [`ObjectStoreExt`] for additional convenience methods.
619625
///
620626
/// # Contract
621-
/// This trait is meant as a contract between object store implementations
622-
/// (e.g. providers, wrappers) and the `object_store` crate itself and is
627+
/// This trait is a contract between object store _implementations_
628+
/// (e.g. providers, wrappers) and the `object_store` crate itself. It is
623629
/// intended to be the minimum API required for an object store.
624630
///
625-
/// The [`ObjectStoreExt`] acts as an API/contract between `object_store`
626-
/// and the store users and provides additional methods that may be simpler to use but overlap
627-
/// in functionality with [`ObjectStore`].
631+
/// The [`ObjectStoreExt`] acts as an API/contract between `object_store` and
632+
/// the store _users_ and provides additional methods that may be simpler to use
633+
/// but overlap in functionality with [`ObjectStore`].
634+
///
635+
/// # Minimal Default Implementations
636+
/// There are only a few default implementations for methods in this trait by
637+
/// design. This was different from versions prior to `0.13.0`, which had many
638+
/// more default implementations. Default implementations are convenient for
639+
/// users, but error-prone for implementors as they require keeping the
640+
/// convenience APIs correctly in sync.
641+
///
642+
/// As of version 0.13.0, most methods on [`ObjectStore`] must be implemented, and
643+
/// the convenience methods have been moved to the [`ObjectStoreExt`] trait as
644+
/// described above. See [#385] for more details.
645+
///
646+
/// [#385]: https://github.com/apache/arrow-rs-object-store/issues/385
628647
///
629648
/// # Wrappers
630649
/// If you wrap an [`ObjectStore`] -- e.g. to add observability -- you SHOULD
@@ -1136,7 +1155,9 @@ as_ref_impl!(Box<T>);
11361155

11371156
/// Extension trait for [`ObjectStore`] with convenience functions.
11381157
///
1139-
/// See "contract" section within the [`ObjectStore`] documentation for more reasoning.
1158+
/// See the [module-level documentation](crate) for a high leve overview and
1159+
/// examples. See "contract" section within the [`ObjectStore`] documentation
1160+
/// for more reasoning.
11401161
///
11411162
/// # Implementation
11421163
/// You MUST NOT implement this trait yourself. It is automatically implemented for all [`ObjectStore`] implementations.

0 commit comments

Comments
 (0)