Enum Region

Source
pub enum Region {
Show 24 variants ApEast1, ApNortheast1, ApNortheast2, ApNortheast3, ApSouth1, ApSoutheast1, ApSoutheast2, CaCentral1, EuCentral1, EuWest1, EuWest2, EuWest3, EuNorth1, MeSouth1, SaEast1, UsEast1, UsEast2, UsWest1, UsWest2, UsGovEast1, UsGovWest1, CnNorth1, CnNorthwest1, Custom { name: String, endpoint: String, },
}
Expand description

An AWS region.

§Default

Region implements the Default trait. Calling Region::default() will attempt to read the AWS_DEFAULT_REGION or AWS_REGION environment variable. If it is malformed, it will fall back to Region::UsEast1. If it is not present it will fallback on the value associated with the current profile in ~/.aws/config or the file specified by the AWS_CONFIG_FILE environment variable. If that is malformed of absent it will fall back on Region::UsEast1

§AWS-compatible services

Region::Custom can be used to connect to AWS-compatible services such as DynamoDB Local or Ceph.

    Region::Custom {
        name: "eu-east-3".to_owned(),
        endpoint: "http://localhost:8000".to_owned(),
    };

§Caveats

CnNorth1 is currently untested due to Rusoto maintainers not having access to AWS China.

Variants§

§

ApEast1

Region that covers the Eastern part of Asia Pacific

§

ApNortheast1

Region that covers the North-Eastern part of Asia Pacific

§

ApNortheast2

Region that covers the North-Eastern part of Asia Pacific

§

ApNortheast3

Region that covers the North-Eastern part of Asia Pacific

§

ApSouth1

Region that covers the Southern part of Asia Pacific

§

ApSoutheast1

Region that covers the South-Eastern part of Asia Pacific

§

ApSoutheast2

Region that covers the South-Eastern part of Asia Pacific

§

CaCentral1

Region that covers Canada

§

EuCentral1

Region that covers Central Europe

§

EuWest1

Region that covers Western Europe

§

EuWest2

Region that covers Western Europe

§

EuWest3

Region that covers Western Europe

§

EuNorth1

Region that covers Northern Europe

§

MeSouth1

Bahrain, Middle East South

§

SaEast1

Region that covers South America

§

UsEast1

Region that covers the Eastern part of the United States

§

UsEast2

Region that covers the Eastern part of the United States

§

UsWest1

Region that covers the Western part of the United States

§

UsWest2

Region that covers the Western part of the United States

§

UsGovEast1

Region that covers the Eastern part of the United States for the US Government

§

UsGovWest1

Region that covers the Western part of the United States for the US Government

§

CnNorth1

Region that covers China

§

CnNorthwest1

Region that covers North-Western part of China

§

Custom

Specifies a custom region, such as a local Ceph target

Fields

§name: String

Name of the endpoint (e.g. "eu-east-2").

§endpoint: String

Endpoint to be used. For instance, "https://s3.my-provider.net" or just "s3.my-provider.net" (default scheme is https).

Implementations§

Source§

impl Region

Source

pub fn name(&self) -> &str

Name of the region

    assert_eq!(Region::CaCentral1.name(), "ca-central-1");
    assert_eq!(
        Region::Custom { name: "eu-east-3".to_owned(), endpoint: "s3.net".to_owned() }.name(),
        "eu-east-3"
    );

Trait Implementations§

Source§

impl Clone for Region

Source§

fn clone(&self) -> Region

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Region

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for Region

Source§

fn default() -> Region

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Region

Source§

fn deserialize<D>( deserializer: D, ) -> Result<Region, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl FromStr for Region

Source§

type Err = ParseRegionError

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Region, ParseRegionError>

Parses a string s to return a value of this type. Read more
Source§

impl Hash for Region

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Region

Source§

fn eq(&self, other: &Region) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Region

Source§

fn serialize<S>( &self, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for Region

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<'i, T> Captures1<'i> for T

Source§

impl<'i, T> Captures2<'i> for T

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,