Skip to main content

HttpProtocol

Struct HttpProtocol 

Source
pub struct HttpProtocol;
Expand description

Built-in HTTP protocol ("http").

Implementations§

Source§

impl HttpProtocol

Source

pub fn attach_contract(&self, meta: &HttpContractMeta) -> ProtocolAttachment

Attach contract-level HTTP metadata.

Source

pub fn attach_operation(&self, meta: &HttpOperationMeta) -> ProtocolAttachment

Attach operation-level HTTP metadata.

Source

pub fn attach_response(&self, meta: &HttpResponseMeta) -> ProtocolAttachment

Attach success response HTTP metadata.

Source

pub fn attach_error(&self, meta: &HttpErrorMeta) -> ProtocolAttachment

Attach error response HTTP metadata.

Source

pub fn attach_parameter(&self, meta: &HttpParameterMeta) -> ProtocolAttachment

Attach parameter HTTP metadata.

Source

pub fn operation_meta( method: &str, path: &str, request_streaming: bool, response_streaming: bool, ) -> HttpOperationMeta

Build HttpOperationMeta from method, path, and streaming flags.

Source

pub fn response_meta(status: &str, media_type: &str) -> HttpResponseMeta

Build HttpResponseMeta from a status key and optional media type.

Source

pub fn error_meta(status: &str, description: &str) -> HttpErrorMeta

Build HttpErrorMeta from a status key.

Source

pub fn parameter_meta( name: &str, location: &str, required: bool, ) -> HttpParameterMeta

Build HttpParameterMeta from OpenAPI parameter fields.

Source

pub fn contract_meta( server_urls: &[String], default: Option<&str>, ) -> HttpContractMeta

Build HttpContractMeta from server URLs.

Source

pub fn severity_for_status_code(code: u16) -> ResponseSeverity

Classify numeric HTTP status for populate.

Source

pub fn is_error_status(status: &str) -> bool

True when the status code represents an error outcome.

Trait Implementations§

Source§

impl Clone for HttpProtocol

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl Copy for HttpProtocol

Source§

impl Debug for HttpProtocol

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for HttpProtocol

Source§

fn default() -> HttpProtocol

Returns the “default value” for a type. Read more
Source§

impl ErrorProtocol for HttpProtocol

Source§

type ErrorMeta = HttpErrorMeta

Typed error metadata payload.
Source§

fn error_severity(&self, error_key: &str) -> ResponseSeverity

Map an error key to ResponseSeverity.
Source§

fn format_error_label(&self, error_key: &str) -> String

Human-readable error label for documentation.
Source§

impl FieldCarrierProtocol for HttpProtocol

Source§

fn field_carrier_kinds(&self) -> &'static [&'static str]

Valid carrier kinds for this protocol.
Source§

fn valid_parameter_locations(&self) -> &'static [&'static str]

Valid parameter locations for this protocol.
Source§

impl OperationProtocol for HttpProtocol

Source§

type OperationMeta = HttpOperationMeta

Typed operation metadata payload.
Source§

fn format_signature(&self, meta: &Self::OperationMeta) -> String

Human-facing operation signature line.
Source§

fn operation_title_hint(&self, meta: &Self::OperationMeta) -> Option<String>

Optional title hint derived from operation metadata.
Source§

impl Protocol for HttpProtocol

Source§

fn id(&self) -> &'static str

Protocol slug (for example "http", "grpc").
Source§

impl ResponseProtocol for HttpProtocol

Source§

fn response_severity(&self, status_key: &str) -> ResponseSeverity

Map a family-specific status key to ResponseSeverity.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.