pub struct ConversionRegistry { /* private fields */ }Expand description
Registry mapping (source, target) format pairs to converters.
Implementations§
Source§impl ConversionRegistry
impl ConversionRegistry
pub fn new() -> Self
Sourcepub fn register_converter(&mut self, converter: impl Converter + 'static)
pub fn register_converter(&mut self, converter: impl Converter + 'static)
Register an atomic converter for a format pair.
Sourcepub fn register_stream_converter(
&mut self,
converter: impl StreamConverter + 'static,
)
pub fn register_stream_converter( &mut self, converter: impl StreamConverter + 'static, )
Register a streaming converter for a format pair.
Sourcepub fn register_detector(&mut self, detector: impl FormatDetector + 'static)
pub fn register_detector(&mut self, detector: impl FormatDetector + 'static)
Register a format detector.
Sourcepub fn get_converter(
&self,
source: &FormatId,
target: &FormatId,
) -> Option<&dyn Converter>
pub fn get_converter( &self, source: &FormatId, target: &FormatId, ) -> Option<&dyn Converter>
Look up an atomic converter.
Sourcepub fn get_stream_converter(
&self,
source: &FormatId,
target: &FormatId,
) -> Option<&dyn StreamConverter>
pub fn get_stream_converter( &self, source: &FormatId, target: &FormatId, ) -> Option<&dyn StreamConverter>
Look up a streaming converter.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ConversionRegistry
impl !RefUnwindSafe for ConversionRegistry
impl Send for ConversionRegistry
impl Sync for ConversionRegistry
impl Unpin for ConversionRegistry
impl UnsafeUnpin for ConversionRegistry
impl !UnwindSafe for ConversionRegistry
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