pub struct ServiceSchema<'a> { /* private fields */ }Expand description
Runtime descriptor for a Smithy service shape.
Implementations§
Source§impl<'a> ServiceSchema<'a>
impl<'a> ServiceSchema<'a>
Sourcepub const fn new(
shape_id: ShapeId<'a>,
version: Option<&'a str>,
protocols: &'a [ShapeId<'a>],
operations: &'a [&'a OperationSchema<'a>],
) -> Self
pub const fn new( shape_id: ShapeId<'a>, version: Option<&'a str>, protocols: &'a [ShapeId<'a>], operations: &'a [&'a OperationSchema<'a>], ) -> Self
Creates a service descriptor.
protocols lists the shape IDs of the protocols the service serves,
and operations lists every operation bound to the service, including
operations bound through resources.
Sourcepub const fn with_traits(self, traits: &'a LazyLock<TraitMap>) -> Self
pub const fn with_traits(self, traits: &'a LazyLock<TraitMap>) -> Self
Attaches the traits applied to the service shape. Mirrors [Schema::with_traits].
Sourcepub fn traits(&self) -> Option<&TraitMap>
pub fn traits(&self) -> Option<&TraitMap>
Returns the traits recorded for the service shape, initializing them on first access.
Sourcepub fn protocols(&self) -> &'a [ShapeId<'a>]
pub fn protocols(&self) -> &'a [ShapeId<'a>]
Returns the shape IDs of the protocols applied to this service.
Sourcepub fn operations(&self) -> &'a [&'a OperationSchema<'a>]
pub fn operations(&self) -> &'a [&'a OperationSchema<'a>]
Returns the operations bound to this service.
Sourcepub fn operation(&self, id: &ShapeId<'_>) -> Option<&'a OperationSchema<'a>>
pub fn operation(&self, id: &ShapeId<'_>) -> Option<&'a OperationSchema<'a>>
Returns the operation with the given shape ID, if bound to this service.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for ServiceSchema<'a>
impl<'a> !RefUnwindSafe for ServiceSchema<'a>
impl<'a> Send for ServiceSchema<'a>
impl<'a> Sync for ServiceSchema<'a>
impl<'a> Unpin for ServiceSchema<'a>
impl<'a> UnsafeUnpin for ServiceSchema<'a>
impl<'a> !UnwindSafe for ServiceSchema<'a>
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
§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.