Skip to main content

ExtensionDescriptorRegistry

Struct ExtensionDescriptorRegistry 

Source
pub struct ExtensionDescriptorRegistry { /* private fields */ }
Expand description

Acyclic protocol-only descriptor registry.

Implementations§

Source§

impl ExtensionDescriptorRegistry

Source

pub fn new() -> Self

Builds an empty registry; extensions are disabled until a descriptor is registered.

Source

pub fn register( &mut self, descriptor: ExtensionDescriptor, ) -> Result<(), ExtensionRegistryError>

Adds one descriptor after validating all descriptor-local and cross-owner rules.

Source

pub fn register_method( &mut self, id: &ExtensionId, method: ExtensionMethodDescriptor, ) -> Result<(), ExtensionRegistryError>

Adds another request method to an already registered extension descriptor.

One extension can own more than one request method. The extension’s settings, resolver, notification, and result discriminator stay on the original descriptor so every additional method shares the same negotiated capability and frozen receipt.

Source

pub fn freeze( &mut self, ) -> Result<ExtensionRegistryReceipt, ExtensionRegistryError>

Freezes this registry and returns its canonical domain-separated digest receipt.

Source

pub fn receipt(&self) -> Option<&ExtensionRegistryReceipt>

Returns the frozen receipt, if this registry has been frozen.

Source

pub fn descriptor(&self, id: &ExtensionId) -> Option<&ExtensionDescriptor>

Returns a descriptor by its exact registered identifier.

Source

pub fn method_descriptor( &self, id: &ExtensionId, name: &str, ) -> Option<&ExtensionMethodDescriptor>

Returns the descriptor for one extension-owned request method.

This includes the primary descriptor method and every additional method registered for the same extension capability. Server handler registries use it to reject handler configurations that could never be admitted at request dispatch.

Source

pub fn descriptors(&self) -> impl ExactSizeIterator<Item = &ExtensionDescriptor>

Returns the frozen descriptors in deterministic identifier order.

Source

pub fn preserve_unknown_peer_extensions( &self, peer: BTreeMap<ExtensionId, ExtensionSettings>, ) -> BTreeMap<ExtensionId, ExtensionSettings>

Preserves unknown peer settings as inert diagnostic data.

Source

pub fn negotiate<R>( &self, protocol_era: ProtocolEra, local: &ExtensionLocalEnablement, client: &ClientExtensionDiscovery, server: &ServerExtensionDiscovery, resolver: &mut R, ) -> Result<NegotiatedExtensionSet, ExtensionNegotiationError>

Derives one frozen, bilateral extension set for the current exchange.

The typed resolver is called only for descriptors enabled by both local gates and advertised by both peers on this exchange. The generic registry preserves the peer objects independently; it never treats JSON-object equality as compatibility.

Trait Implementations§

Source§

impl Clone for ExtensionDescriptorRegistry

Source§

fn clone(&self) -> ExtensionDescriptorRegistry

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 Debug for ExtensionDescriptorRegistry

Source§

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

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

impl Default for ExtensionDescriptorRegistry

Source§

fn default() -> ExtensionDescriptorRegistry

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

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Instrument for T

Source§

fn instrument(self, _span: NoopSpan) -> Self

Instruments this future with a span (no-op when disabled).
Source§

fn in_current_span(self) -> Self

Instruments this future with the current span (no-op when disabled).
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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V