Skip to content

Commit

Permalink
docs: Add more guide for Accessor
Browse files Browse the repository at this point in the history
Signed-off-by: Xuanwo <[email protected]>
  • Loading branch information
Xuanwo committed Feb 24, 2023
1 parent 631ab70 commit 6a2adbd
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
25 changes: 23 additions & 2 deletions src/docs/internals/accessor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,29 @@
//! The internal implement details of [`Accessor`].
//!
//! [`Accessor`] is the core trait of OpenDAL's raw API. We operate
//! underlying storage services via APIs provided by [`Accessor`]. Let's go
//! deep into [`Accessor`] line by line.
//! underlying storage services via APIs provided by [`Accessor`].
//!
//! [`Accessor`] can be split in the following parts:
//!
//! ```ignore
//! // Attributes
//! #[async_trait]
//! // <----------Trait Bound-------------->
//! pub trait Accessor: Send + Sync + Debug + Unpin + 'static {
//! type Reader: output::Read; // --+
//! type BlockingReader: output::BlockingRead; // +--> Associated Type
//! type Pager: output::Page; // +
//! type BlockingPager: output::BlockingPage; // --+
//!
//! // APIs
//! async fn hello(&self, path: &str, args: OpCreate) -> Result<RpCreate>;
//! async fn world(&self, path: &str, args: OpCreate) -> Result<RpCreate>;
//! }
//! ```
//!
//! Let's go deep into [`Accessor`] line by line.
//!
//!
//!
//! ## Async Trait
//!
Expand Down
4 changes: 2 additions & 2 deletions src/docs/internals/layer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

//! The internal implement details of [`Layer`].
//!
//! [`Layer`] itsef is quiet simple:
//! [`Layer`] itself is quiet simple:
//!
//! ```ignore
//! pub trait Layer<A: Accessor> {
Expand All @@ -31,7 +31,7 @@
//!
//! Most layer only implements part of [`Accessor`], so we provide
//! [`LayeredAccessor`] which will forward all not implemented methods to
//! `inner`. It's highly recommand to implement [`LayeredAccessor`] trait
//! `inner`. It's highly recommend to implement [`LayeredAccessor`] trait
//! instead.
//!
//! [`Layer`]: crate::raw::Layer
Expand Down

1 comment on commit 6a2adbd

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for opendal ready!

✅ Preview
https://opendal-5pstxexz7-databend.vercel.app
https://opendal-git-add-more-about-accessor.vercel.app

Built with commit 6a2adbd.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.