Skip to main content

GrpcProtocol

Struct GrpcProtocol 

Source
pub struct GrpcProtocol;
Expand description

Built-in gRPC protocol ("grpc").

Implementations§

Source§

impl GrpcProtocol

Source

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

Attach contract-level gRPC metadata.

Source

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

Attach operation-level gRPC metadata.

Source

pub fn attach_status(&self, meta: &GrpcStatusMeta) -> ProtocolAttachment

Attach success status gRPC metadata.

Source

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

Attach error gRPC metadata.

Source

pub fn attach_metadata(&self, meta: &GrpcMetadataMeta) -> ProtocolAttachment

Attach metadata key gRPC metadata.

Source

pub fn operation_meta( rpc_name: &str, client_streaming: bool, server_streaming: bool, ) -> GrpcOperationMeta

Build GrpcOperationMeta from RPC descriptor fields.

Source

pub fn status_meta_ok() -> GrpcStatusMeta

Build GrpcStatusMeta for OK responses.

Source

pub fn error_meta(code_name: &str, message: &str) -> GrpcErrorMeta

Build GrpcErrorMeta from a status name.

Source

pub fn metadata_meta(key: &str, required: bool) -> GrpcMetadataMeta

Source

pub fn contract_meta(package_name: &str) -> GrpcContractMeta

Source

pub fn severity_for_code(code: i32) -> ResponseSeverity

Classify gRPC status code for populate.

Trait Implementations§

Source§

impl Clone for GrpcProtocol

Source§

fn clone(&self) -> GrpcProtocol

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 GrpcProtocol

Source§

impl Debug for GrpcProtocol

Source§

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

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

impl Default for GrpcProtocol

Source§

fn default() -> GrpcProtocol

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

impl ErrorProtocol for GrpcProtocol

Source§

type ErrorMeta = GrpcErrorMeta

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 GrpcProtocol

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 GrpcProtocol

Source§

type OperationMeta = GrpcOperationMeta

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 GrpcProtocol

Source§

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

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

impl ResponseProtocol for GrpcProtocol

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.