Enum s3::Region

source ·
pub enum Region {
Show 33 variants UsEast1, UsEast2, UsWest1, UsWest2, CaCentral1, AfSouth1, ApEast1, ApSouth1, ApNortheast1, ApNortheast2, ApNortheast3, ApSoutheast1, ApSoutheast2, CnNorth1, CnNorthwest1, EuNorth1, EuCentral1, EuWest1, EuWest2, EuWest3, MeSouth1, SaEast1, DoNyc3, DoAms3, DoSgp1, DoFra1, Yandex, WaUsEast1, WaUsEast2, WaUsWest1, WaEuCentral1, R2 { 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

§

EuWest1

eu-west-1

§

EuWest2

eu-west-2

§

EuWest3

eu-west-3

§

MeSouth1

me-south-1

§

SaEast1

sa-east-1

§

DoNyc3

Digital Ocean nyc3

§

DoAms3

Digital Ocean ams3

§

DoSgp1

Digital Ocean sgp1

§

DoFra1

Digiral Ocean fra1

§

Yandex

Yandex Object Storage

§

WaUsEast1

Wasabi us-east-1

§

WaUsEast2

Wasabi us-east-2

§

WaUsWest1

Wasabi us-west-1

§

WaEuCentral1

Wasabi eu-central-1

§

R2

Fields

§account_id: String

Custom region

§

Custom

Fields

§region: String
§endpoint: String

Implementations§

source§

impl Region

source

pub fn endpoint(&self) -> String

source

pub fn scheme(&self) -> String

source

pub fn host(&self) -> String

Trait Implementations§

source§

impl Clone for Region

source§

fn clone(&self) -> Region

Returns a copy of the value. Read more
1.0.0 · source§

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 Display for Region

source§

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

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

impl FromStr for Region

§

type Err = Utf8Error

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

fn from_str(s: &str) -> Result<Region, <Region as FromStr>::Err>

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

impl PartialEq<Region> for Region

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for Region

source§

impl StructuralEq for Region

source§

impl StructuralPartialEq for Region

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<Q, K> Equivalent<K> for Qwhere 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

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

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

fn in_current_span(self) -> Instrumented<Self>

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

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

const: unstable · 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> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

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> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more