pub struct GotRegion { /* private fields */ }
Expand description

获取的区域信息

Implementations§

获取的区域信息

Examples found in repository?
src/regions/regions_provider/mod.rs (line 160)
159
160
161
    fn deref(&self) -> &Self::Target {
        self.region()
    }
More examples
Hide additional examples
src/regions/endpoints_provider/endpoints.rs (line 104)
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
    pub(super) fn from_region_provider(
        region_provider: &dyn RegionsProvider,
        services: &[ServiceName],
    ) -> ApiResult<Self> {
        Ok(Self::from_region(
            region_provider.get(Default::default())?.region(),
            services,
        ))
    }

    #[cfg(feature = "async")]
    pub(super) async fn async_from_region_provider(
        region_provider: &dyn RegionsProvider,
        services: &[ServiceName],
    ) -> ApiResult<Self> {
        Ok(Self::from_region(
            region_provider.async_get(Default::default()).await?.region(),
            services,
        ))
    }

获取的区域信息的可变引用

Examples found in repository?
src/regions/regions_provider/mod.rs (line 167)
166
167
168
    fn deref_mut(&mut self) -> &mut Self::Target {
        self.region_mut()
    }

获取的生命周期

获取的生命周期的可变引用

转换为区域信息

Examples found in repository?
src/regions/regions_provider/mod.rs (line 49)
48
49
50
51
    fn get_all(&self, opts: GetOptions) -> ApiResult<GotRegions> {
        let region = self.get(opts)?.into_region();
        Ok(vec![region].into())
    }

Methods from Deref<Target = Region>§

获取区域 ID

获取 S3 区域 ID

获取上传服务主要终端列表

up().preferred() 等效

获取上传服务备选终端列表

up().alternative() 等效

获取下载服务主要终端列表

io().preferred() 等效

获取下载服务备选终端列表

io().alternative() 等效

获取存储空间管理服务主要终端列表

uc().preferred() 等效

获取存储空间管理服务备选终端列表

uc().alternative() 等效

获取元数据管理服务主要终端列表

rs().preferred() 等效

获取元数据管理服务备选终端列表

rs().alternative() 等效

获取元数据列举服务主要终端列表

rsf().preferred() 等效

获取元数据列举服务备选终端列表

rsf().alternative() 等效

获取 API 入口服务主要终端列表

api().preferred() 等效

获取 API 入口服务备选终端列表

api().alternative() 等效

获取 S3 入口服务主要终端列表

s3().preferred() 等效

获取 S3 入口服务备选终端列表

s3().alternative() 等效

获取上传服务终端地址列表

Examples found in repository?
src/regions/region.rs (line 63)
62
63
64
65
66
67
68
69
70
71
72
    pub fn up_preferred_endpoints(&self) -> &[Endpoint] {
        self.up().preferred()
    }

    /// 获取上传服务备选终端列表
    ///
    /// 与 `up().alternative()` 等效
    #[inline]
    pub fn up_alternative_endpoints(&self) -> &[Endpoint] {
        self.up().alternative()
    }
More examples
Hide additional examples
src/regions/endpoints_provider/endpoints.rs (line 85)
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
    fn from_region(region: &Region, services: &[ServiceName]) -> Self {
        let mut builder = EndpointsBuilder {
            preferred: vec![],
            alternative: vec![],
        };

        for service in services {
            let e = match service {
                ServiceName::Up => region.up(),
                ServiceName::Io => region.io(),
                ServiceName::Uc => region.uc(),
                ServiceName::Rs => region.rs(),
                ServiceName::Rsf => region.rsf(),
                ServiceName::Api => region.api(),
                ServiceName::S3 => region.s3(),
            };
            builder.preferred.extend_from_slice(e.preferred());
            builder.alternative.extend_from_slice(e.alternative());
        }
        builder.build()
    }

获取下载服务终端地址列表

Examples found in repository?
src/regions/region.rs (line 79)
78
79
80
81
82
83
84
85
86
87
88
    pub fn io_preferred_endpoints(&self) -> &[Endpoint] {
        self.io().preferred()
    }

    /// 获取下载服务备选终端列表
    ///
    /// 与 `io().alternative()` 等效
    #[inline]
    pub fn io_alternative_endpoints(&self) -> &[Endpoint] {
        self.io().alternative()
    }
More examples
Hide additional examples
src/regions/endpoints_provider/endpoints.rs (line 86)
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
    fn from_region(region: &Region, services: &[ServiceName]) -> Self {
        let mut builder = EndpointsBuilder {
            preferred: vec![],
            alternative: vec![],
        };

        for service in services {
            let e = match service {
                ServiceName::Up => region.up(),
                ServiceName::Io => region.io(),
                ServiceName::Uc => region.uc(),
                ServiceName::Rs => region.rs(),
                ServiceName::Rsf => region.rsf(),
                ServiceName::Api => region.api(),
                ServiceName::S3 => region.s3(),
            };
            builder.preferred.extend_from_slice(e.preferred());
            builder.alternative.extend_from_slice(e.alternative());
        }
        builder.build()
    }

获取存储空间管理服务终端地址列表

Examples found in repository?
src/regions/region.rs (line 95)
94
95
96
97
98
99
100
101
102
103
104
    pub fn uc_preferred_endpoints(&self) -> &[Endpoint] {
        self.uc().preferred()
    }

    /// 获取存储空间管理服务备选终端列表
    ///
    /// 与 `uc().alternative()` 等效
    #[inline]
    pub fn uc_alternative_endpoints(&self) -> &[Endpoint] {
        self.uc().alternative()
    }
More examples
Hide additional examples
src/regions/endpoints_provider/endpoints.rs (line 87)
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
    fn from_region(region: &Region, services: &[ServiceName]) -> Self {
        let mut builder = EndpointsBuilder {
            preferred: vec![],
            alternative: vec![],
        };

        for service in services {
            let e = match service {
                ServiceName::Up => region.up(),
                ServiceName::Io => region.io(),
                ServiceName::Uc => region.uc(),
                ServiceName::Rs => region.rs(),
                ServiceName::Rsf => region.rsf(),
                ServiceName::Api => region.api(),
                ServiceName::S3 => region.s3(),
            };
            builder.preferred.extend_from_slice(e.preferred());
            builder.alternative.extend_from_slice(e.alternative());
        }
        builder.build()
    }

获取元数据管理服务终端地址列表

Examples found in repository?
src/regions/region.rs (line 111)
110
111
112
113
114
115
116
117
118
119
120
    pub fn rs_preferred_endpoints(&self) -> &[Endpoint] {
        self.rs().preferred()
    }

    /// 获取元数据管理服务备选终端列表
    ///
    /// 与 `rs().alternative()` 等效
    #[inline]
    pub fn rs_alternative_endpoints(&self) -> &[Endpoint] {
        self.rs().alternative()
    }
More examples
Hide additional examples
src/regions/endpoints_provider/endpoints.rs (line 88)
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
    fn from_region(region: &Region, services: &[ServiceName]) -> Self {
        let mut builder = EndpointsBuilder {
            preferred: vec![],
            alternative: vec![],
        };

        for service in services {
            let e = match service {
                ServiceName::Up => region.up(),
                ServiceName::Io => region.io(),
                ServiceName::Uc => region.uc(),
                ServiceName::Rs => region.rs(),
                ServiceName::Rsf => region.rsf(),
                ServiceName::Api => region.api(),
                ServiceName::S3 => region.s3(),
            };
            builder.preferred.extend_from_slice(e.preferred());
            builder.alternative.extend_from_slice(e.alternative());
        }
        builder.build()
    }

获取元数据列举服务终端地址列表

Examples found in repository?
src/regions/region.rs (line 127)
126
127
128
129
130
131
132
133
134
135
136
    pub fn rsf_preferred_endpoints(&self) -> &[Endpoint] {
        self.rsf().preferred()
    }

    /// 获取元数据列举服务备选终端列表
    ///
    /// 与 `rsf().alternative()` 等效
    #[inline]
    pub fn rsf_alternative_endpoints(&self) -> &[Endpoint] {
        self.rsf().alternative()
    }
More examples
Hide additional examples
src/regions/endpoints_provider/endpoints.rs (line 89)
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
    fn from_region(region: &Region, services: &[ServiceName]) -> Self {
        let mut builder = EndpointsBuilder {
            preferred: vec![],
            alternative: vec![],
        };

        for service in services {
            let e = match service {
                ServiceName::Up => region.up(),
                ServiceName::Io => region.io(),
                ServiceName::Uc => region.uc(),
                ServiceName::Rs => region.rs(),
                ServiceName::Rsf => region.rsf(),
                ServiceName::Api => region.api(),
                ServiceName::S3 => region.s3(),
            };
            builder.preferred.extend_from_slice(e.preferred());
            builder.alternative.extend_from_slice(e.alternative());
        }
        builder.build()
    }

获取 API 入口服务终端地址列表

Examples found in repository?
src/regions/region.rs (line 143)
142
143
144
145
146
147
148
149
150
151
152
    pub fn api_preferred_endpoints(&self) -> &[Endpoint] {
        self.api().preferred()
    }

    /// 获取 API 入口服务备选终端列表
    ///
    /// 与 `api().alternative()` 等效
    #[inline]
    pub fn api_alternative_endpoints(&self) -> &[Endpoint] {
        self.api().alternative()
    }
More examples
Hide additional examples
src/regions/endpoints_provider/endpoints.rs (line 90)
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
    fn from_region(region: &Region, services: &[ServiceName]) -> Self {
        let mut builder = EndpointsBuilder {
            preferred: vec![],
            alternative: vec![],
        };

        for service in services {
            let e = match service {
                ServiceName::Up => region.up(),
                ServiceName::Io => region.io(),
                ServiceName::Uc => region.uc(),
                ServiceName::Rs => region.rs(),
                ServiceName::Rsf => region.rsf(),
                ServiceName::Api => region.api(),
                ServiceName::S3 => region.s3(),
            };
            builder.preferred.extend_from_slice(e.preferred());
            builder.alternative.extend_from_slice(e.alternative());
        }
        builder.build()
    }

获取 S3 入口服务终端地址列表

Examples found in repository?
src/regions/region.rs (line 159)
158
159
160
161
162
163
164
165
166
167
168
    pub fn s3_preferred_endpoints(&self) -> &[Endpoint] {
        self.s3().preferred()
    }

    /// 获取 S3 入口服务备选终端列表
    ///
    /// 与 `s3().alternative()` 等效
    #[inline]
    pub fn s3_alternative_endpoints(&self) -> &[Endpoint] {
        self.s3().alternative()
    }
More examples
Hide additional examples
src/regions/endpoints_provider/endpoints.rs (line 91)
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
    fn from_region(region: &Region, services: &[ServiceName]) -> Self {
        let mut builder = EndpointsBuilder {
            preferred: vec![],
            alternative: vec![],
        };

        for service in services {
            let e = match service {
                ServiceName::Up => region.up(),
                ServiceName::Io => region.io(),
                ServiceName::Uc => region.uc(),
                ServiceName::Rs => region.rs(),
                ServiceName::Rsf => region.rsf(),
                ServiceName::Api => region.api(),
                ServiceName::S3 => region.s3(),
            };
            builder.preferred.extend_from_slice(e.preferred());
            builder.alternative.extend_from_slice(e.alternative());
        }
        builder.build()
    }

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
The resulting type after dereferencing.
Dereferences the value.
Mutably dereferences the value.
Deserialize this value from the given Serde deserializer. Read more
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
返回七牛区域信息 Read more
返回多个七牛区域信息 Read more
Available on crate feature async only.
异步返回七牛区域信息
Available on crate feature async only.
异步返回多个七牛区域信息
Serialize this value into the given Serde serializer. Read more
The type returned in the event of a conversion error.
Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Converts self into T using Into<T>. Read more
Compare self to key and return true if they are equal.

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Pipes by value. This is generally the method you want to use. Read more
Borrows self and passes that borrow into the pipe function. Read more
Mutably borrows self and passes that borrow into the pipe function. Read more
Borrows self, then passes self.borrow() into the pipe function. Read more
Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Borrows self, then passes self.as_ref() into the pipe function.
Mutably borrows self, then passes self.as_mut() into the pipe function.
Borrows self, then passes self.deref() into the pipe function.
Mutably borrows self, then passes self.deref_mut() into the pipe function.
Should always be Self
Immutable access to a value. Read more
Mutable access to a value. Read more
Immutable access to the Borrow<B> of a value. Read more
Mutable access to the BorrowMut<B> of a value. Read more
Immutable access to the AsRef<R> view of a value. Read more
Mutable access to the AsMut<R> view of a value. Read more
Immutable access to the Deref::Target of a value. Read more
Mutable access to the Deref::Target of a value. Read more
Calls .tap() only in debug builds, and is erased in release builds.
Calls .tap_mut() only in debug builds, and is erased in release builds.
Calls .tap_borrow() only in debug builds, and is erased in release builds.
Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
Calls .tap_ref() only in debug builds, and is erased in release builds.
Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
Calls .tap_deref() only in debug builds, and is erased in release builds.
Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Attempts to convert self into T using TryInto<T>. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more