pub struct HttpProtocol;Expand description
Built-in HTTP protocol ("http").
Implementations§
Source§impl HttpProtocol
impl HttpProtocol
Sourcepub fn attach_contract(&self, meta: &HttpContractMeta) -> ProtocolAttachment
pub fn attach_contract(&self, meta: &HttpContractMeta) -> ProtocolAttachment
Attach contract-level HTTP metadata.
Sourcepub fn attach_operation(&self, meta: &HttpOperationMeta) -> ProtocolAttachment
pub fn attach_operation(&self, meta: &HttpOperationMeta) -> ProtocolAttachment
Attach operation-level HTTP metadata.
Sourcepub fn attach_response(&self, meta: &HttpResponseMeta) -> ProtocolAttachment
pub fn attach_response(&self, meta: &HttpResponseMeta) -> ProtocolAttachment
Attach success response HTTP metadata.
Sourcepub fn attach_error(&self, meta: &HttpErrorMeta) -> ProtocolAttachment
pub fn attach_error(&self, meta: &HttpErrorMeta) -> ProtocolAttachment
Attach error response HTTP metadata.
Sourcepub fn attach_parameter(&self, meta: &HttpParameterMeta) -> ProtocolAttachment
pub fn attach_parameter(&self, meta: &HttpParameterMeta) -> ProtocolAttachment
Attach parameter HTTP metadata.
Sourcepub fn operation_meta(
method: &str,
path: &str,
request_streaming: bool,
response_streaming: bool,
) -> HttpOperationMeta
pub fn operation_meta( method: &str, path: &str, request_streaming: bool, response_streaming: bool, ) -> HttpOperationMeta
Build HttpOperationMeta from method, path, and streaming flags.
Sourcepub fn response_meta(status: &str, media_type: &str) -> HttpResponseMeta
pub fn response_meta(status: &str, media_type: &str) -> HttpResponseMeta
Build HttpResponseMeta from a status key and optional media type.
Sourcepub fn error_meta(status: &str, description: &str) -> HttpErrorMeta
pub fn error_meta(status: &str, description: &str) -> HttpErrorMeta
Build HttpErrorMeta from a status key.
Sourcepub fn parameter_meta(
name: &str,
location: &str,
required: bool,
) -> HttpParameterMeta
pub fn parameter_meta( name: &str, location: &str, required: bool, ) -> HttpParameterMeta
Build HttpParameterMeta from OpenAPI parameter fields.
Sourcepub fn contract_meta(
server_urls: &[String],
default: Option<&str>,
) -> HttpContractMeta
pub fn contract_meta( server_urls: &[String], default: Option<&str>, ) -> HttpContractMeta
Build HttpContractMeta from server URLs.
Sourcepub fn severity_for_status_code(code: u16) -> ResponseSeverity
pub fn severity_for_status_code(code: u16) -> ResponseSeverity
Classify numeric HTTP status for populate.
Sourcepub fn is_error_status(status: &str) -> bool
pub fn is_error_status(status: &str) -> bool
True when the status code represents an error outcome.
Trait Implementations§
Source§impl Clone for HttpProtocol
impl Clone for HttpProtocol
Source§fn clone(&self) -> HttpProtocol
fn clone(&self) -> HttpProtocol
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for HttpProtocol
Source§impl Debug for HttpProtocol
impl Debug for HttpProtocol
Source§impl Default for HttpProtocol
impl Default for HttpProtocol
Source§fn default() -> HttpProtocol
fn default() -> HttpProtocol
Returns the “default value” for a type. Read more
Source§impl ErrorProtocol for HttpProtocol
impl ErrorProtocol for HttpProtocol
Source§type ErrorMeta = HttpErrorMeta
type ErrorMeta = HttpErrorMeta
Typed error metadata payload.
Source§fn error_severity(&self, error_key: &str) -> ResponseSeverity
fn error_severity(&self, error_key: &str) -> ResponseSeverity
Map an error key to
ResponseSeverity.Source§fn format_error_label(&self, error_key: &str) -> String
fn format_error_label(&self, error_key: &str) -> String
Human-readable error label for documentation.
Source§impl FieldCarrierProtocol for HttpProtocol
impl FieldCarrierProtocol for HttpProtocol
Source§fn field_carrier_kinds(&self) -> &'static [&'static str]
fn field_carrier_kinds(&self) -> &'static [&'static str]
Valid carrier kinds for this protocol.
Source§fn valid_parameter_locations(&self) -> &'static [&'static str]
fn valid_parameter_locations(&self) -> &'static [&'static str]
Valid parameter locations for this protocol.
Source§impl OperationProtocol for HttpProtocol
impl OperationProtocol for HttpProtocol
Source§type OperationMeta = HttpOperationMeta
type OperationMeta = HttpOperationMeta
Typed operation metadata payload.
Source§fn format_signature(&self, meta: &Self::OperationMeta) -> String
fn format_signature(&self, meta: &Self::OperationMeta) -> String
Human-facing operation signature line.
Source§fn operation_title_hint(&self, meta: &Self::OperationMeta) -> Option<String>
fn operation_title_hint(&self, meta: &Self::OperationMeta) -> Option<String>
Optional title hint derived from operation metadata.
Source§impl Protocol for HttpProtocol
impl Protocol for HttpProtocol
Source§impl ResponseProtocol for HttpProtocol
impl ResponseProtocol for HttpProtocol
Source§fn response_severity(&self, status_key: &str) -> ResponseSeverity
fn response_severity(&self, status_key: &str) -> ResponseSeverity
Map a family-specific status key to
ResponseSeverity.Auto Trait Implementations§
impl Freeze for HttpProtocol
impl RefUnwindSafe for HttpProtocol
impl Send for HttpProtocol
impl Sync for HttpProtocol
impl Unpin for HttpProtocol
impl UnsafeUnpin for HttpProtocol
impl UnwindSafe for HttpProtocol
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