pub struct EnumCodec { /* private fields */ }Expand description
Strict enum names mapped to an integer database field. Empty and unknown names/codes are errors; results use the same names accepted by input.
Implementations§
Trait Implementations§
Source§impl Codec for EnumCodec
impl Codec for EnumCodec
Source§fn parse(&self, _field: &FieldMeta, input: &str) -> Result<ScalarValue, String>
fn parse(&self, _field: &FieldMeta, input: &str) -> Result<ScalarValue, String>
Convert one external value into the field’s validated query value.
Source§fn format_result(
&self,
_field: &FieldMeta,
value: RowValue,
) -> Result<RowValue, String>
fn format_result( &self, _field: &FieldMeta, value: RowValue, ) -> Result<RowValue, String>
Convert one decoded result value into its public representation.
Source§fn fingerprint(&self) -> u64
fn fingerprint(&self) -> u64
Stable identity including codec configuration.
Source§fn format_input(
&self,
field: &FieldMeta,
value: &ScalarValue,
) -> Result<String, String>
fn format_input( &self, field: &FieldMeta, value: &ScalarValue, ) -> Result<String, String>
Canonical RPC representation. Encoders verify that parsing this text
recovers the original database value; lossy codecs must override it.
Auto Trait Implementations§
impl Freeze for EnumCodec
impl RefUnwindSafe for EnumCodec
impl Send for EnumCodec
impl Sync for EnumCodec
impl Unpin for EnumCodec
impl UnsafeUnpin for EnumCodec
impl UnwindSafe for EnumCodec
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