pub trait RegionsProvider: DynClone + Debug + Sync + Send {
    // Required method
    fn get(&self, opts: GetOptions) -> Result<GotRegion, Error>;

    // Provided methods
    fn get_all(&self, opts: GetOptions) -> Result<GotRegions, Error> { ... }
    fn async_get(
        &self,
        opts: GetOptions
    ) -> Pin<Box<dyn Future<Output = Result<GotRegion, Error>> + Send, Global>> { ... }
    fn async_get_all(
        &self,
        opts: GetOptions
    ) -> Pin<Box<dyn Future<Output = Result<GotRegions, Error>> + Send, Global>> { ... }
}
Expand description

区域信息获取接口

可以获取一个区域也可以获取多个区域

同时提供阻塞获取接口和异步获取接口,异步获取接口则需要启用 async 功能

Required Methods§

fn get(&self, opts: GetOptions) -> Result<GotRegion, Error>

返回七牛区域信息

该方法的异步版本为 Self::async_get

Provided Methods§

fn get_all(&self, opts: GetOptions) -> Result<GotRegions, Error>

返回多个七牛区域信息

该方法的异步版本为 Self::async_get_all

fn async_get( &self, opts: GetOptions ) -> Pin<Box<dyn Future<Output = Result<GotRegion, Error>> + Send, Global>>

异步返回七牛区域信息

fn async_get_all( &self, opts: GetOptions ) -> Pin<Box<dyn Future<Output = Result<GotRegions, Error>> + Send, Global>>

异步返回多个七牛区域信息

Implementations on Foreign Types§

§

impl<T> RegionsProvider for Arc<T>where T: RegionsProvider + ?Sized, Arc<T>: DynClone + Debug + Sync + Send,

§

fn get(&self, opts: GetOptions) -> Result<GotRegion, Error>

§

fn get_all(&self, opts: GetOptions) -> Result<GotRegions, Error>

§

fn async_get( &self, opts: GetOptions ) -> Pin<Box<dyn Future<Output = Result<GotRegion, Error>> + Send, Global>>

§

fn async_get_all( &self, opts: GetOptions ) -> Pin<Box<dyn Future<Output = Result<GotRegions, Error>> + Send, Global>>

§

impl<'a, T> RegionsProvider for &'a mut Twhere T: 'a + RegionsProvider + ?Sized, &'a mut T: DynClone + Debug + Sync + Send,

§

fn get(&self, opts: GetOptions) -> Result<GotRegion, Error>

§

fn get_all(&self, opts: GetOptions) -> Result<GotRegions, Error>

§

fn async_get( &self, opts: GetOptions ) -> Pin<Box<dyn Future<Output = Result<GotRegion, Error>> + Send, Global>>

§

fn async_get_all( &self, opts: GetOptions ) -> Pin<Box<dyn Future<Output = Result<GotRegions, Error>> + Send, Global>>

§

impl<T> RegionsProvider for Box<T, Global>where T: RegionsProvider + ?Sized, Box<T, Global>: DynClone + Debug + Sync + Send,

§

fn get(&self, opts: GetOptions) -> Result<GotRegion, Error>

§

fn get_all(&self, opts: GetOptions) -> Result<GotRegions, Error>

§

fn async_get( &self, opts: GetOptions ) -> Pin<Box<dyn Future<Output = Result<GotRegion, Error>> + Send, Global>>

§

fn async_get_all( &self, opts: GetOptions ) -> Pin<Box<dyn Future<Output = Result<GotRegions, Error>> + Send, Global>>

§

impl<T> RegionsProvider for Rc<T>where T: RegionsProvider + ?Sized, Rc<T>: DynClone + Debug + Sync + Send,

§

fn get(&self, opts: GetOptions) -> Result<GotRegion, Error>

§

fn get_all(&self, opts: GetOptions) -> Result<GotRegions, Error>

§

fn async_get( &self, opts: GetOptions ) -> Pin<Box<dyn Future<Output = Result<GotRegion, Error>> + Send, Global>>

§

fn async_get_all( &self, opts: GetOptions ) -> Pin<Box<dyn Future<Output = Result<GotRegions, Error>> + Send, Global>>

§

impl<'a, T> RegionsProvider for &'a Twhere T: 'a + RegionsProvider + ?Sized, &'a T: DynClone + Debug + Sync + Send,

§

fn get(&self, opts: GetOptions) -> Result<GotRegion, Error>

§

fn get_all(&self, opts: GetOptions) -> Result<GotRegions, Error>

§

fn async_get( &self, opts: GetOptions ) -> Pin<Box<dyn Future<Output = Result<GotRegion, Error>> + Send, Global>>

§

fn async_get_all( &self, opts: GetOptions ) -> Pin<Box<dyn Future<Output = Result<GotRegions, Error>> + Send, Global>>

Implementors§

§

impl RegionsProvider for AllRegionsProvider

§

impl RegionsProvider for BucketRegionsProvider

§

impl RegionsProvider for GotRegion

§

impl RegionsProvider for GotRegions

§

impl RegionsProvider for Region

§

impl RegionsProvider for StaticRegionsProvider