pub enum Region {
Show 54 variants
UsEast1,
UsEast2,
UsWest1,
UsWest2,
CaCentral1,
AfSouth1,
ApEast1,
ApSouth1,
ApNortheast1,
ApNortheast2,
ApNortheast3,
ApSoutheast1,
ApSoutheast2,
CnNorth1,
CnNorthwest1,
EuNorth1,
EuCentral1,
EuCentral2,
EuWest1,
EuWest2,
EuWest3,
IlCentral1,
MeSouth1,
SaEast1,
DoNyc3,
DoAms3,
DoSgp1,
DoFra1,
OvhGra,
OvhRbx,
OvhSbg,
OvhDe,
OvhUk,
OvhWaw,
OvhBhs,
OvhCaEastTor,
OvhSgp,
Yandex,
WaUsEast1,
WaUsEast2,
WaUsCentral1,
WaUsWest1,
WaCaCentral1,
WaEuCentral1,
WaEuCentral2,
WaEuWest1,
WaEuWest2,
WaApNortheast1,
WaApNortheast2,
WaApSoutheast1,
WaApSoutheast2,
R2 {
account_id: String,
},
R2Eu {
account_id: String,
},
Custom {
region: String,
endpoint: String,
},
}
Expand description
AWS S3 region identifier, passing in custom values is also possible, in that case it is up to you to pass a valid endpoint, otherwise boom will happen :)
Serde support available with the serde
feature
§Example
use std::str::FromStr;
use awsregion::Region;
// Parse from a string
let region: Region = "us-east-1".parse().unwrap();
// Choose region directly
let region = Region::EuWest2;
// Custom region requires valid region name and endpoint
let region_name = "nl-ams".to_string();
let endpoint = "https://s3.nl-ams.scw.cloud".to_string();
let region = Region::Custom { region: region_name, endpoint };
Variants§
UsEast1
us-east-1
UsEast2
us-east-2
UsWest1
us-west-1
UsWest2
us-west-2
CaCentral1
ca-central-1
AfSouth1
af-south-1
ApEast1
ap-east-1
ApSouth1
ap-south-1
ApNortheast1
ap-northeast-1
ApNortheast2
ap-northeast-2
ApNortheast3
ap-northeast-3
ApSoutheast1
ap-southeast-1
ApSoutheast2
ap-southeast-2
CnNorth1
cn-north-1
CnNorthwest1
cn-northwest-1
EuNorth1
eu-north-1
EuCentral1
eu-central-1
EuCentral2
eu-central-2
EuWest1
eu-west-1
EuWest2
eu-west-2
EuWest3
eu-west-3
IlCentral1
il-central-1
MeSouth1
me-south-1
SaEast1
sa-east-1
DoNyc3
Digital Ocean nyc3
DoAms3
Digital Ocean ams3
DoSgp1
Digital Ocean sgp1
DoFra1
Digital Ocean fra1
OvhGra
Yandex Object Storage
OvhRbx
gra
OvhSbg
rbx
OvhDe
sbg
OvhUk
de
OvhWaw
uk
OvhBhs
waw
OvhCaEastTor
bhs
OvhSgp
ca-east-tor
Yandex
sgp
WaUsEast1
Wasabi us-east-1
WaUsEast2
Wasabi us-east-2
WaUsCentral1
Wasabi us-central-1
WaUsWest1
Wasabi us-west-1
WaCaCentral1
Wasabi ca-central-1
WaEuCentral1
Wasabi eu-central-1
WaEuCentral2
Wasabi eu-central-2
WaEuWest1
Wasabi eu-west-1
WaEuWest2
Wasabi eu-west-2
WaApNortheast1
Wasabi ap-northeast-1
WaApNortheast2
Wasabi ap-northeast-2
WaApSoutheast1
Wasabi ap-southeast-1
WaApSoutheast2
Wasabi ap-southeast-2
R2
Cloudflare R2 (global)
R2Eu
Cloudflare R2 EU jurisdiction
Custom
Custom region
Implementations§
Source§impl Region
impl Region
pub fn endpoint(&self) -> String
pub fn scheme(&self) -> String
pub fn host(&self) -> String
pub fn from_env( region_env: &str, endpoint_env: Option<&str>, ) -> Result<Region, RegionError>
Sourcepub fn from_default_env() -> Result<Region, RegionError>
pub fn from_default_env() -> Result<Region, RegionError>
Attempts to create a Region from AWS_REGION and AWS_ENDPOINT environment variables
Trait Implementations§
impl Eq for Region
impl StructuralPartialEq for Region
Auto Trait Implementations§
impl Freeze for Region
impl RefUnwindSafe for Region
impl Send for Region
impl Sync for Region
impl Unpin for Region
impl UnwindSafe for Region
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString
. Read moreSource§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.