Skip to main content

ExtendedCatalog

Struct ExtendedCatalog 

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

A runtime-extensible catalog wrapping the static CATALOG.

Supports additional custom decoders and custom artifact descriptors. The base catalog is unmodified.

Implementations§

Source§

impl ExtendedCatalog

Source

pub fn new() -> Self

Create a new ExtendedCatalog wrapping the global static CATALOG.

Source

pub fn register_decoder<D: CustomDecoder + 'static>(&mut self, decoder: D)

Register a custom decoder.

Source

pub fn register_descriptor(&mut self, descriptor: ArtifactDescriptor)

Register a custom artifact descriptor.

Source

pub fn by_id(&self, id: &str) -> Option<&ArtifactDescriptor>

Look up an artifact descriptor by ID, checking custom descriptors first.

Source

pub fn len(&self) -> usize

Returns the total number of descriptors (base + custom).

Source

pub fn is_empty(&self) -> bool

Returns true if there are no descriptors.

Source

pub fn custom_decoder(&self, id: &str) -> Option<&dyn CustomDecoder>

Find a custom decoder by ID.

Source

pub fn custom_decoder_count(&self) -> usize

Returns the number of registered custom decoders.

Source

pub fn custom_descriptor_count(&self) -> usize

Returns the number of registered custom descriptors.

Trait Implementations§

Source§

impl Default for ExtendedCatalog

Source§

fn default() -> Self

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<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, 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.