pub struct ShapeId { /* private fields */ }Expand description
A Smithy Shape ID.
Shape IDs uniquely identify shapes in a Smithy model.
Use the shape_id! macro to construct instances — it computes the
fully qualified name at compile time from the namespace and shape name,
preventing the parts from getting out of sync.
§Examples
use aws_smithy_schema::{shape_id, ShapeId};
const ID: ShapeId = shape_id!("smithy.api", "String");
assert_eq!(ID.namespace(), "smithy.api");
assert_eq!(ID.shape_name(), "String");
assert_eq!(ID.as_str(), "smithy.api#String");Implementations§
Source§impl ShapeId
impl ShapeId
Sourcepub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
Returns the fully qualified string representation (e.g. "smithy.api#String").
Sourcepub fn shape_name(&self) -> &str
pub fn shape_name(&self) -> &str
Returns the shape name portion of the ShapeId.
Sourcepub fn member_name(&self) -> Option<&str>
pub fn member_name(&self) -> Option<&str>
Returns the member name if this is a member shape ID.
Trait Implementations§
impl Copy for ShapeId
impl Eq for ShapeId
impl StructuralPartialEq for ShapeId
Auto Trait Implementations§
impl Freeze for ShapeId
impl RefUnwindSafe for ShapeId
impl Send for ShapeId
impl Sync for ShapeId
impl Unpin for ShapeId
impl UnwindSafe for ShapeId
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
Mutably borrows from an owned value. Read more
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
Checks if this value is equivalent to the given key. Read more
§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
Compare self to
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>
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 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>
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 moreCreates a shared type from an unshared type.