pub struct Schema { /* private fields */ }Implementations§
Source§impl Schema
impl Schema
Sourcepub const fn new(id: ShapeId, shape_type: ShapeType) -> Self
pub const fn new(id: ShapeId, shape_type: ShapeType) -> Self
Creates a schema for a simple type (no members).
Sourcepub const fn new_struct(
id: ShapeId,
shape_type: ShapeType,
members: &'static [&'static Schema],
) -> Self
pub const fn new_struct( id: ShapeId, shape_type: ShapeType, members: &'static [&'static Schema], ) -> Self
Creates a schema for a structure or union type.
Sourcepub const fn new_list(id: ShapeId, member: &'static Schema) -> Self
pub const fn new_list(id: ShapeId, member: &'static Schema) -> Self
Creates a schema for a list type.
Sourcepub const fn new_map(
id: ShapeId,
key: &'static Schema,
value: &'static Schema,
) -> Self
pub const fn new_map( id: ShapeId, key: &'static Schema, value: &'static Schema, ) -> Self
Creates a schema for a map type.
Sourcepub const fn new_member(
id: ShapeId,
shape_type: ShapeType,
member_name: &'static str,
member_index: usize,
) -> Self
pub const fn new_member( id: ShapeId, shape_type: ShapeType, member_name: &'static str, member_index: usize, ) -> Self
Creates a member schema wrapping a target schema.
Sourcepub fn shape_type(&self) -> ShapeType
pub fn shape_type(&self) -> ShapeType
Returns the shape type.
Sourcepub fn traits(&self) -> Option<&TraitMap>
pub fn traits(&self) -> Option<&TraitMap>
Returns the fallback trait map for unknown/custom traits.
Sourcepub fn sensitive(&self) -> Option<&SensitiveTrait>
pub fn sensitive(&self) -> Option<&SensitiveTrait>
Returns the @sensitive trait if present.
Sourcepub fn json_name(&self) -> Option<&JsonNameTrait>
pub fn json_name(&self) -> Option<&JsonNameTrait>
Returns the @jsonName value if present.
Sourcepub fn timestamp_format(&self) -> Option<&TimestampFormatTrait>
pub fn timestamp_format(&self) -> Option<&TimestampFormatTrait>
Returns the @timestampFormat if present.
Sourcepub fn xml_name(&self) -> Option<&XmlNameTrait>
pub fn xml_name(&self) -> Option<&XmlNameTrait>
Returns the @xmlName value if present.
Sourcepub fn xml_namespace(&self) -> Option<&XmlNamespaceTrait>
pub fn xml_namespace(&self) -> Option<&XmlNamespaceTrait>
Returns the @xmlNamespace value if present.
Sourcepub fn xml_attribute(&self) -> bool
pub fn xml_attribute(&self) -> bool
Returns true if this member has the @xmlAttribute trait.
Sourcepub fn xml_flattened(&self) -> bool
pub fn xml_flattened(&self) -> bool
Returns true if this member has the @xmlFlattened trait.
Sourcepub fn xml_unwrapped_output(&self) -> bool
pub fn xml_unwrapped_output(&self) -> bool
Returns true if this struct’s XML wire format omits the outer
wrapper element. See field doc for details.
Sourcepub fn has_body_members(&self) -> bool
pub fn has_body_members(&self) -> bool
Returns true if this struct has at least one member that serializes
to the request/response body, false if every member is HTTP-bound.
Sourcepub fn has_http_response_binding(&self) -> bool
pub fn has_http_response_binding(&self) -> bool
Returns the @httpHeader value if present.
Returns true if this member schema has any HTTP response binding trait
(@httpHeader, @httpResponseCode, @httpPrefixHeaders, or @httpPayload).
pub fn http_header(&self) -> Option<&HttpHeaderTrait>
Sourcepub fn http_query(&self) -> Option<&HttpQueryTrait>
pub fn http_query(&self) -> Option<&HttpQueryTrait>
Returns the @httpQuery value if present.
Sourcepub fn http_label(&self) -> Option<&HttpLabelTrait>
pub fn http_label(&self) -> Option<&HttpLabelTrait>
Returns the @httpLabel trait if present.
Sourcepub fn http_payload(&self) -> Option<&HttpPayloadTrait>
pub fn http_payload(&self) -> Option<&HttpPayloadTrait>
Returns the @httpPayload trait if present.
Sourcepub fn http_prefix_headers(&self) -> Option<&HttpPrefixHeadersTrait>
pub fn http_prefix_headers(&self) -> Option<&HttpPrefixHeadersTrait>
Returns the @httpPrefixHeaders value if present.
Sourcepub fn media_type(&self) -> Option<&MediaTypeTrait>
pub fn media_type(&self) -> Option<&MediaTypeTrait>
Returns the @mediaType trait if present.
Sourcepub fn http_query_params(&self) -> Option<&HttpQueryParamsTrait>
pub fn http_query_params(&self) -> Option<&HttpQueryParamsTrait>
Returns the @httpQueryParams trait if present.
Sourcepub fn http_response_code(&self) -> Option<&HttpResponseCodeTrait>
pub fn http_response_code(&self) -> Option<&HttpResponseCodeTrait>
Returns the @httpResponseCode trait if present.
Sourcepub fn http(&self) -> Option<&HttpTrait>
pub fn http(&self) -> Option<&HttpTrait>
Returns the @http trait if present.
This is an operation-level trait included on the input schema for convenience so the protocol serializer can construct the request URI.
Sourcepub const fn with_original_name(self, name: &'static str) -> Self
pub const fn with_original_name(self, name: &'static str) -> Self
Sets the original (pre-synthesis) shape name for synthetic operation
input/output shapes. See Schema::original_name for semantics.
Sourcepub const fn with_map_members(
self,
key: &'static Schema,
value: &'static Schema,
) -> Self
pub const fn with_map_members( self, key: &'static Schema, value: &'static Schema, ) -> Self
Attaches key and value member schemas to a map member schema.
Used by the XML codec to resolve <key> and <value> element names.
Sourcepub const fn with_list_member(self, member: &'static Schema) -> Self
pub const fn with_list_member(self, member: &'static Schema) -> Self
Sets the list member schema on a member schema that targets a list.
Sourcepub const fn with_sensitive(self) -> Self
pub const fn with_sensitive(self) -> Self
Sets the @sensitive trait.
Sourcepub const fn with_json_name(self, value: &'static str) -> Self
pub const fn with_json_name(self, value: &'static str) -> Self
Sets the @jsonName trait.
Sourcepub const fn with_timestamp_format(self, format: TimestampFormat) -> Self
pub const fn with_timestamp_format(self, format: TimestampFormat) -> Self
Sets the @timestampFormat trait.
Sourcepub const fn with_xml_name(self, value: &'static str) -> Self
pub const fn with_xml_name(self, value: &'static str) -> Self
Sets the @xmlName trait.
Sourcepub const fn with_xml_attribute(self) -> Self
pub const fn with_xml_attribute(self) -> Self
Sets the @xmlAttribute trait.
Sourcepub const fn with_xml_flattened(self) -> Self
pub const fn with_xml_flattened(self) -> Self
Sets the @xmlFlattened trait.
Sourcepub const fn with_xml_unwrapped_output(self) -> Self
pub const fn with_xml_unwrapped_output(self) -> Self
Marks the struct as an unwrapped XML output. See field doc for details.
Sourcepub const fn with_no_body_members(self) -> Self
pub const fn with_no_body_members(self) -> Self
Marks this struct as having no body members — every member is HTTP-bound.
See has_body_members for what this enables.
Sourcepub const fn with_http_header(self, value: &'static str) -> Self
pub const fn with_http_header(self, value: &'static str) -> Self
Sets the @httpHeader trait.
Sourcepub const fn with_http_label(self) -> Self
pub const fn with_http_label(self) -> Self
Sets the @httpLabel trait.
Sourcepub const fn with_http_payload(self) -> Self
pub const fn with_http_payload(self) -> Self
Sets the @httpPayload trait.
Sourcepub const fn with_http_prefix_headers(self, value: &'static str) -> Self
pub const fn with_http_prefix_headers(self, value: &'static str) -> Self
Sets the @httpPrefixHeaders trait.
Sourcepub const fn with_http_query(self, value: &'static str) -> Self
pub const fn with_http_query(self, value: &'static str) -> Self
Sets the @httpQuery trait.
Sourcepub const fn with_http_query_params(self) -> Self
pub const fn with_http_query_params(self) -> Self
Sets the @httpQueryParams trait.
Sourcepub const fn with_http_response_code(self) -> Self
pub const fn with_http_response_code(self) -> Self
Sets the @httpResponseCode trait.
Sourcepub const fn with_http(self, http: HttpTrait) -> Self
pub const fn with_http(self, http: HttpTrait) -> Self
Sets the @http trait (operation-level, included on input schema for convenience).
Sourcepub const fn with_streaming(self) -> Self
pub const fn with_streaming(self) -> Self
Sets the @streaming trait.
Sourcepub const fn with_event_header(self) -> Self
pub const fn with_event_header(self) -> Self
Sets the @eventHeader trait.
Sourcepub const fn with_event_payload(self) -> Self
pub const fn with_event_payload(self) -> Self
Sets the @eventPayload trait.
Sourcepub const fn with_host_label(self) -> Self
pub const fn with_host_label(self) -> Self
Sets the @hostLabel trait.
Sourcepub const fn with_media_type(self, value: &'static str) -> Self
pub const fn with_media_type(self, value: &'static str) -> Self
Sets the @mediaType trait.
Sourcepub const fn with_xml_namespace(
self,
uri: &'static str,
prefix: Option<&'static str>,
) -> Self
pub const fn with_xml_namespace( self, uri: &'static str, prefix: Option<&'static str>, ) -> Self
Sets the @xmlNamespace trait.
uri is the namespace URI; prefix optionally declares the
xmlns:prefix form. Pass None for the default (unprefixed)
xmlns="uri" declaration.
Sourcepub const fn with_traits(self, traits: &'static LazyLock<TraitMap>) -> Self
pub const fn with_traits(self, traits: &'static LazyLock<TraitMap>) -> Self
Sets the fallback trait map for unknown/custom traits.
Sourcepub fn member_name(&self) -> Option<&'static str>
pub fn member_name(&self) -> Option<&'static str>
Returns the member name if this is a member schema.
Returns Option<&'static str> so callers can store the name in
Cow::Borrowed or other 'static-lifetime contexts without
allocating, matching the underlying field type.
Sourcepub fn member_index(&self) -> Option<usize>
pub fn member_index(&self) -> Option<usize>
Returns the member index for member schemas.
This is used internally by generated code for efficient member lookup. Consumer code should not rely on specific position values as they may change.
Sourcepub fn original_name(&self) -> Option<&str>
pub fn original_name(&self) -> Option<&str>
Returns the original (pre-synthesis) shape name for synthetic operation input/output shapes.
None for non-synthetic shapes. See the field documentation for full
semantics.
Sourcepub fn member_schema(&self, name: &str) -> Option<&Schema>
pub fn member_schema(&self, name: &str) -> Option<&Schema>
Returns the member schema by name (for structures and unions).
Sourcepub fn member_schema_by_index(&self, index: usize) -> Option<&Schema>
pub fn member_schema_by_index(&self, index: usize) -> Option<&Schema>
Returns the member name and schema by position index (for structures and unions).
This is an optimization for generated code to avoid string lookups. Consumer code should not rely on specific position values as they may change.
Sourcepub fn member(&self) -> Option<&Schema>
pub fn member(&self) -> Option<&Schema>
Returns the member schema for collections (list member or map value).
Sourcepub fn member_static(&self) -> Option<&'static Schema>
pub fn member_static(&self) -> Option<&'static Schema>
Like member but returns the 'static borrow that
codegen actually stores. Needed when callers (e.g. the XML codec)
must hold a reference to a value/element member schema across nested
callbacks without inheriting the parent borrow’s lifetime.
Sourcepub fn key_static(&self) -> Option<&'static Schema>
pub fn key_static(&self) -> Option<&'static Schema>
Like key but returns the 'static borrow that codegen
stores. See member_static.
Sourcepub fn is_structure(&self) -> bool
pub fn is_structure(&self) -> bool
Returns true if this is a structure schema.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Schema
impl !UnwindSafe for Schema
impl Freeze for Schema
impl Send for Schema
impl Sync for Schema
impl Unpin for Schema
impl UnsafeUnpin for Schema
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> 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