pub struct ValueCodecRegistration<D: 'static> { /* private fields */ }Expand description
One statically linked value-codec implementation.
A registration bundles the stable identifier used for lookup and duplicate
detection, a borrowed executable descriptor, and the link-time location the
registration was declared at. It is produced by
register_value_string_codec! or
register_value_bytes_codec!
rather than built by hand.
The registration macros validate codecs through the matching descriptor.
Encoder and decoder error types must implement Error + Send + Sync + 'static; codec and value types do not need those bounds.
Implementations§
Source§impl<D: 'static> ValueCodecRegistration<D>
impl<D: 'static> ValueCodecRegistration<D>
Sourcepub const fn id(&self) -> ValueCodecId
pub const fn id(&self) -> ValueCodecId
Returns the stable value-codec ID.
Sourcepub const fn descriptor(&self) -> &'static D
pub const fn descriptor(&self) -> &'static D
Returns the executable descriptor.
Sourcepub const fn source(&self) -> ValueCodecRegistrationSource
pub const fn source(&self) -> ValueCodecRegistrationSource
Returns the linked source location.
Trait Implementations§
Source§impl<D: Clone + 'static> Clone for ValueCodecRegistration<D>
impl<D: Clone + 'static> Clone for ValueCodecRegistration<D>
impl<D: Copy + 'static> Copy for ValueCodecRegistration<D>
Auto Trait Implementations§
impl<D> Freeze for ValueCodecRegistration<D>where
&'static D: Freeze,
impl<D> RefUnwindSafe for ValueCodecRegistration<D>where
&'static D: RefUnwindSafe,
impl<D> Send for ValueCodecRegistration<D>where
&'static D: Send,
impl<D> Sync for ValueCodecRegistration<D>where
&'static D: Sync,
impl<D> Unpin for ValueCodecRegistration<D>where
&'static D: Unpin,
impl<D> UnsafeUnpin for ValueCodecRegistration<D>where
&'static D: UnsafeUnpin,
impl<D> UnwindSafe for ValueCodecRegistration<D>where
&'static D: UnwindSafe,
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