Commit 949998dd authored by Nugine's avatar Nugine
Browse files

s3s: export s3 operation

parent 17bee1cc
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ mod http;
mod ops;
mod request;
mod response;
mod s3_op;
mod s3_trait;
mod sig_v2;
mod sig_v4;
@@ -48,4 +49,5 @@ pub use self::error::*;
pub use self::http::Body;
pub use self::request::S3Request;
pub use self::response::S3Response;
pub use self::s3_op::S3Operation;
pub use self::s3_trait::S3;
+19 −0
Original line number Diff line number Diff line
pub struct S3Operation {
    pub(crate) name: &'static str,
}

impl S3Operation {
    /// Returns the name of the operation.
    ///
    /// # Example
    /// ```
    /// use s3s::S3Operation;
    /// fn is_basic_list_op(op: &S3Operation) -> bool {
    ///     matches!(op.name(), "ListBuckets" | "ListObjects" | "ListObjectsV2")
    /// }
    /// ```
    #[must_use]
    pub fn name(&self) -> &str {
        self.name
    }
}