pub struct ProtocolRegistration { /* private fields */ }Expand description
A single protocol’s entry in a ProtocolRegistry.
Names the protocol it provides, wraps the factory that builds it, and carries the protocol’s
ProtocolOrder placement. Const-constructible, so registrations live in static registries.
Implementations§
Source§impl ProtocolRegistration
impl ProtocolRegistration
Sourcepub const fn metadata_routed<P: MetadataRoutedProtocol>(
protocol_id: &'static str,
) -> Self
pub const fn metadata_routed<P: MetadataRoutedProtocol>( protocol_id: &'static str, ) -> Self
Registers the metadata-routed protocol P for the protocol trait protocol_id.
P is built only for services whose schema declares protocol_id, and must answer the
same ID from protocol_id.
Sourcepub const fn body_routed<P: BodyRoutedProtocol>(
protocol_id: &'static str,
) -> Self
pub const fn body_routed<P: BodyRoutedProtocol>( protocol_id: &'static str, ) -> Self
Registers the body-routed protocol P for the protocol trait protocol_id.
P is built only for services whose schema declares protocol_id, and must answer the
same ID from protocol_id. The routing service
hands P only the service’s non-streaming operations; see
BodyRoutedProtocol.
Sourcepub const fn with_order(self, order: &'static [ProtocolOrder]) -> Self
pub const fn with_order(self, order: &'static [ProtocolOrder]) -> Self
Constrains where the protocol sits in a multi-protocol service’s claim order.
Trait Implementations§
Source§impl Clone for ProtocolRegistration
impl Clone for ProtocolRegistration
Source§fn clone(&self) -> ProtocolRegistration
fn clone(&self) -> ProtocolRegistration
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProtocolRegistration
impl Debug for ProtocolRegistration
impl Copy for ProtocolRegistration
Auto Trait Implementations§
impl Freeze for ProtocolRegistration
impl RefUnwindSafe for ProtocolRegistration
impl Send for ProtocolRegistration
impl Sync for ProtocolRegistration
impl Unpin for ProtocolRegistration
impl UnsafeUnpin for ProtocolRegistration
impl UnwindSafe for ProtocolRegistration
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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>
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