#[non_exhaustive]pub struct ServiceShapeNamespace(/* private fields */);Expand description
The namespace of the Smithy service shape a client was generated for.
This is the com.amazonaws.dynamodb in com.amazonaws.dynamodb#DynamoDB_20120810.
Together with ServiceShapeName it forms the service’s full shape ID; the two are
separate entries rather than one because [ConfigBag] is keyed by type, so each protocol
loads exactly the facts it needs and new facts stay additive.
Not to be confused with ServiceXmlNamespace, despite the shared word. That one is
the @xmlNamespace trait — a URI restXml applies as the default xmlns on root
elements — and neither value is derivable from the other. CloudWatch Logs is the clearest
illustration: its shape-ID namespace is com.amazonaws.cloudwatchlogs while its
@xmlNamespace URI is http://monitoring.amazonaws.com/doc/2014-03-28/. The trait is
also optional, carried by roughly half of AWS service shapes, whereas every shape ID has
a namespace by construction — which is why this entry is stored unconditionally and
ServiceXmlNamespace is not.
Protocols use this as the default namespace when resolving a document type’s shape
discriminator. Some services serialize a discriminator as a bare shape name rather than an
absolute shape ID — a __type of Widget instead of com.example#Widget — and the
receiving client is expected to qualify it with the service’s namespace. Without it a
relative discriminator cannot be resolved to a registered type at all.
Stored for the same reason as ServiceShapeName: it is knowable only from the model, and
a customer may select a different protocol at runtime via Config::builder().protocol(..)
on a client generated for some other protocol. Baking it into a constructor call at codegen
time means a swapped-in protocol either gets no value or gets one the caller had to know to
supply. Generated clients therefore store it regardless of which protocol they were
generated for.
Implementations§
Source§impl ServiceShapeNamespace
impl ServiceShapeNamespace
Trait Implementations§
Source§impl Clone for ServiceShapeNamespace
impl Clone for ServiceShapeNamespace
Source§fn clone(&self) -> ServiceShapeNamespace
fn clone(&self) -> ServiceShapeNamespace
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ServiceShapeNamespace
impl Debug for ServiceShapeNamespace
Source§impl PartialEq for ServiceShapeNamespace
impl PartialEq for ServiceShapeNamespace
Source§impl Storable for ServiceShapeNamespace
impl Storable for ServiceShapeNamespace
Source§type Storer = StoreReplace<ServiceShapeNamespace>
type Storer = StoreReplace<ServiceShapeNamespace>
StoreReplace] and [StoreAppend]impl Eq for ServiceShapeNamespace
impl StructuralPartialEq for ServiceShapeNamespace
Auto Trait Implementations§
impl Freeze for ServiceShapeNamespace
impl RefUnwindSafe for ServiceShapeNamespace
impl Send for ServiceShapeNamespace
impl Sync for ServiceShapeNamespace
impl Unpin for ServiceShapeNamespace
impl UnsafeUnpin for ServiceShapeNamespace
impl UnwindSafe for ServiceShapeNamespace
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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