pub struct Endpoint { /* private fields */ }
.endpoint_url(...)
directly insteadExpand description
API Endpoint
This implements an API endpoint as specified in the Smithy Endpoint Specification
Implementationsยง
Sourceยงimpl Endpoint
impl Endpoint
Sourcepub fn mutable_uri(uri: Uri) -> Result<Endpoint, InvalidEndpointError>
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
.
Sourcepub fn mutable(uri: impl AsRef<str>) -> Result<Endpoint, InvalidEndpointError>
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
.
Sourcepub fn immutable_uri(uri: Uri) -> Result<Endpoint, InvalidEndpointError>
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.
Sourcepub fn immutable(uri: impl AsRef<str>) -> Result<Endpoint, InvalidEndpointError>
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.
Sourcepub fn set_endpoint(
&self,
uri: &mut Uri,
prefix: Option<&EndpointPrefix>,
) -> Result<(), InvalidEndpointError>
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 ResolveAwsEndpoint for Endpoint
An Endpoint
can be its own resolver to support static endpoints
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>>
fn resolve_endpoint( &self, _region: &Region, ) -> Result<AwsEndpoint, Box<dyn Error + Send + Sync>>
Sourceยงimpl<T> ResolveEndpoint<T> for Endpoint
This allows customers that use Endpoint
to override the endpoint to continue to do so
impl<T> ResolveEndpoint<T> for Endpoint
This allows customers that use Endpoint
to override the endpoint to continue to do so
fn resolve_endpoint( &self, _params: &T, ) -> Result<Endpoint, ResolveEndpointError>
Sourceยงimpl ResolveStediEndpoint for Endpoint
An Endpoint
can be its own resolver to support static endpoints
impl ResolveStediEndpoint for Endpoint
An Endpoint
can be its own resolver to support static endpoints
Sourceยงfn resolve_endpoint(
&self,
_region: &Region,
) -> Result<StediEndpoint, Box<dyn Error + Send + Sync>>
fn resolve_endpoint( &self, _region: &Region, ) -> Result<StediEndpoint, Box<dyn Error + Send + Sync>>
Auto Trait Implementationsยง
impl !Freeze for Endpoint
impl RefUnwindSafe for Endpoint
impl Send for Endpoint
impl Sync for Endpoint
impl Unpin for Endpoint
impl UnwindSafe for Endpoint
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<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> IntoEither for T
impl<T> IntoEither for T
Sourceยงfn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSourceยงfn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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