pub struct ContentCodecFactoryStore { /* private fields */ }Expand description
Store for content codec factories registered by modules during init.
Modules register their factories here, and the pipeline queries it to find a codec for a given content type.
Implementations§
Source§impl ContentCodecFactoryStore
impl ContentCodecFactoryStore
Sourcepub fn add_factory(&self, factory: Arc<dyn ContentCodecFactory>)
pub fn add_factory(&self, factory: Arc<dyn ContentCodecFactory>)
Add a factory to the store.
Called by codec modules during init().
Sourcepub fn find(&self, content_type: &ContentType) -> Option<Box<dyn ContentCodec>>
pub fn find(&self, content_type: &ContentType) -> Option<Box<dyn ContentCodec>>
Find and create a codec for the given content type.
Iterates registered factories, calling create() on each.
Returns the first Some result.
Sourcepub fn take_factories(&self) -> Vec<Arc<dyn ContentCodecFactory>>
pub fn take_factories(&self) -> Vec<Arc<dyn ContentCodecFactory>>
Take all registered factories.
Called by bootstrap after all modules have initialized. This drains the store; subsequent calls return empty vec.
Trait Implementations§
Source§impl Debug for ContentCodecFactoryStore
impl Debug for ContentCodecFactoryStore
Source§impl Default for ContentCodecFactoryStore
impl Default for ContentCodecFactoryStore
Source§fn default() -> ContentCodecFactoryStore
fn default() -> ContentCodecFactoryStore
Returns the “default value” for a type. Read more
impl Service for ContentCodecFactoryStore
Auto Trait Implementations§
impl !Freeze for ContentCodecFactoryStore
impl !RefUnwindSafe for ContentCodecFactoryStore
impl Send for ContentCodecFactoryStore
impl Sync for ContentCodecFactoryStore
impl Unpin for ContentCodecFactoryStore
impl UnsafeUnpin for ContentCodecFactoryStore
impl !UnwindSafe for ContentCodecFactoryStore
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