pub struct OutputCodecRegistry { /* private fields */ }Expand description
Registry of independent textual output codecs, keyed by exact public value type.
The registry’s Any storage is only a heterogeneous type map. After lookup,
callers receive ordinary typed OutputCodec<V> trait objects.
Implementations§
Source§impl OutputCodecRegistry
impl OutputCodecRegistry
Sourcepub fn standard() -> Self
pub fn standard() -> Self
Create the standard registry for rusty-alto’s built-in public value types.
Sourcepub fn register<V: 'static, C>(&mut self, codec: C)
pub fn register<V: 'static, C>(&mut self, codec: C)
Register a textual codec for the exact public value type V.
Sourcepub fn codecs_for<V: 'static>(&self) -> &[Box<TextOutputCodec<V>>]
pub fn codecs_for<V: 'static>(&self) -> &[Box<TextOutputCodec<V>>]
Return textual codecs registered for the exact public value type V.
Accessing this slice or codec metadata does not invoke encoding.
Sourcepub fn codec_for_name<V: 'static>(
&self,
name: &str,
) -> Result<&TextOutputCodec<V>, OutputCodecError>
pub fn codec_for_name<V: 'static>( &self, name: &str, ) -> Result<&TextOutputCodec<V>, OutputCodecError>
Find a textual codec by its case-insensitive metadata name.
Trait Implementations§
Source§impl Default for OutputCodecRegistry
impl Default for OutputCodecRegistry
Source§fn default() -> OutputCodecRegistry
fn default() -> OutputCodecRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for OutputCodecRegistry
impl !UnwindSafe for OutputCodecRegistry
impl Freeze for OutputCodecRegistry
impl Send for OutputCodecRegistry
impl Sync for OutputCodecRegistry
impl Unpin for OutputCodecRegistry
impl UnsafeUnpin for OutputCodecRegistry
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