pub struct InputCodecRegistry { /* private fields */ }Expand description
Registry of input codecs, keyed first by exact result type and then by codec metadata.
Implementations§
Source§impl InputCodecRegistry
impl InputCodecRegistry
Sourcepub fn register<T: 'static, C>(
&mut self,
codec: C,
) -> Result<(), InputCodecRegistryError>where
C: InputCodec<T> + 'static,
pub fn register<T: 'static, C>(
&mut self,
codec: C,
) -> Result<(), InputCodecRegistryError>where
C: InputCodec<T> + 'static,
Register a codec for the exact result type T.
Sourcepub fn codecs_for<T: 'static>(&self) -> &[Box<RegisteredInputCodec<T>>]
pub fn codecs_for<T: 'static>(&self) -> &[Box<RegisteredInputCodec<T>>]
Return all codecs registered for the exact result type T.
Sourcepub fn codec_for_name<T: 'static>(
&self,
name: &str,
) -> Result<&RegisteredInputCodec<T>, InputCodecError>
pub fn codec_for_name<T: 'static>( &self, name: &str, ) -> Result<&RegisteredInputCodec<T>, InputCodecError>
Find a codec for T by its case-insensitive metadata name.
Sourcepub fn codec_for_extension<T: 'static>(
&self,
extension: &str,
) -> Result<&RegisteredInputCodec<T>, InputCodecError>
pub fn codec_for_extension<T: 'static>( &self, extension: &str, ) -> Result<&RegisteredInputCodec<T>, InputCodecError>
Find a codec for T by filename extension.
Sourcepub fn codec_for_path<T: 'static>(
&self,
path: &Path,
) -> Result<&RegisteredInputCodec<T>, InputCodecError>
pub fn codec_for_path<T: 'static>( &self, path: &Path, ) -> Result<&RegisteredInputCodec<T>, InputCodecError>
Find a codec for T from the extension of path.
Trait Implementations§
Source§impl Default for InputCodecRegistry
impl Default for InputCodecRegistry
Source§fn default() -> InputCodecRegistry
fn default() -> InputCodecRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for InputCodecRegistry
impl !UnwindSafe for InputCodecRegistry
impl Freeze for InputCodecRegistry
impl Send for InputCodecRegistry
impl Sync for InputCodecRegistry
impl Unpin for InputCodecRegistry
impl UnsafeUnpin for InputCodecRegistry
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