pub struct RegistryMetadata {
pub preferred_protocol: Option<String>,
pub protocol_configs: HashMap<String, Map<String, Value>>,
/* private fields */
}Fields§
§preferred_protocol: Option<String>The registry’s preferred protocol.
protocol_configs: HashMap<String, Map<String, Value>>Protocol-specific configuration.
Implementations§
Source§impl RegistryMetadata
impl RegistryMetadata
Sourcepub fn preferred_protocol(&self) -> Option<&str>
pub fn preferred_protocol(&self) -> Option<&str>
Returns the registry’s preferred protocol.
The preferred protocol is:
- the
preferredProtocolmetadata field, if given - the protocol configuration key, if only one configuration is given
- the protocol backward-compatible aliases configuration, if only one configuration is given
Sourcepub fn configured_protocols(&self) -> impl Iterator<Item = Cow<'_, str>>
pub fn configured_protocols(&self) -> impl Iterator<Item = Cow<'_, str>>
Returns an iterator of protocols configured by the registry.
Sourcepub fn protocol_config<T: DeserializeOwned>(
&self,
protocol: &str,
) -> Result<Option<T>, Error>
pub fn protocol_config<T: DeserializeOwned>( &self, protocol: &str, ) -> Result<Option<T>, Error>
Deserializes protocol config for the given protocol.
Returns Ok(None) if no configuration is available for the given
protocol.
Returns Err if configuration is available for the given protocol but
deserialization fails.
Trait Implementations§
Source§impl Clone for RegistryMetadata
impl Clone for RegistryMetadata
Source§fn clone(&self) -> RegistryMetadata
fn clone(&self) -> RegistryMetadata
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RegistryMetadata
impl Debug for RegistryMetadata
Source§impl Default for RegistryMetadata
impl Default for RegistryMetadata
Source§fn default() -> RegistryMetadata
fn default() -> RegistryMetadata
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for RegistryMetadata
impl<'de> Deserialize<'de> for RegistryMetadata
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for RegistryMetadata
impl RefUnwindSafe for RegistryMetadata
impl Send for RegistryMetadata
impl Sync for RegistryMetadata
impl Unpin for RegistryMetadata
impl UnwindSafe for RegistryMetadata
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