pub struct Endpoint { /* private fields */ }
👎Deprecated: Use .endpoint_url(...) directly instead
Expand description

API Endpoint

This implements an API endpoint as specified in the Smithy Endpoint Specification

Implementations§

source§

impl Endpoint

source

pub fn mutable_uri(uri: Uri) -> Result<Endpoint, InvalidEndpointError>

Create a new endpoint from a URI

Certain services will augment the endpoint with additional metadata. For example, S3 can prefix the host with the bucket name. If your endpoint does not support this, (for example, when communicating with localhost), use Endpoint::immutable.

source

pub fn mutable(uri: impl AsRef<str>) -> Result<Endpoint, InvalidEndpointError>

Create a new endpoint from a URI string

Certain services will augment the endpoint with additional metadata. For example, S3 can prefix the host with the bucket name. If your endpoint does not support this, (for example, when communicating with localhost), use Endpoint::immutable.

source

pub fn uri(&self) -> &Uri

Returns the URI of this endpoint

source

pub fn immutable_uri(uri: Uri) -> Result<Endpoint, InvalidEndpointError>

Create a new immutable endpoint from a URI

use http::Uri;
let uri = Uri::from_static("http://localhost:8000");
let endpoint = Endpoint::immutable_uri(uri);

Certain services will augment the endpoint with additional metadata. For example, S3 can prefix the host with the bucket name. This constructor creates an endpoint which will ignore those mutations. If you want an endpoint which will obey mutation requests, use Endpoint::mutable instead.

source

pub fn immutable(uri: impl AsRef<str>) -> Result<Endpoint, InvalidEndpointError>

Create a new immutable endpoint from a URI string

let endpoint = Endpoint::immutable("http://localhost:8000");

Certain services will augment the endpoint with additional metadata. For example, S3 can prefix the host with the bucket name. This constructor creates an endpoint which will ignore those mutations. If you want an endpoint which will obey mutation requests, use Endpoint::mutable instead.

source

pub fn set_endpoint( &self, uri: &mut Uri, prefix: Option<&EndpointPrefix> ) -> Result<(), InvalidEndpointError>

Sets the endpoint on uri, potentially applying the specified prefix in the process.

Trait Implementations§

source§

impl Clone for Endpoint

source§

fn clone(&self) -> Endpoint

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 Endpoint

source§

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

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

impl ResolveAwsEndpoint for Endpoint

An Endpoint can be its own resolver to support static endpoints

source§

fn resolve_endpoint( &self, _region: &Region ) -> Result<AwsEndpoint, Box<dyn Error + Send + Sync + 'static, Global>>

Resolves the AWS endpoint for a given region.
source§

impl<T> ResolveEndpoint<T> for Endpoint

This allows customers that use Endpoint to override the endpoint to continue to do so

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<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, 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