pub struct ScalarTextCodec {
pub name: &'static str,
pub field: &'static str,
pub value_type: ValueType,
pub trim: bool,
}Expand description
Configurable text representation for a scalar field. Parsing and result conversion use the same logical type, so cursor and database binds remain typed while the public text format is centralized in one codec.
Fields§
§name: &'static str§field: &'static str§value_type: ValueType§trim: boolTrait Implementations§
Source§impl Clone for ScalarTextCodec
impl Clone for ScalarTextCodec
Source§impl Codec for ScalarTextCodec
impl Codec for ScalarTextCodec
Source§fn parse(&self, _: &FieldMeta, input: &str) -> Result<ScalarValue, String>
fn parse(&self, _: &FieldMeta, input: &str) -> Result<ScalarValue, String>
Convert one external value into the field’s validated query value.
Source§fn format_result(
&self,
_: &FieldMeta,
value: RowValue,
) -> Result<RowValue, String>
fn format_result( &self, _: &FieldMeta, value: RowValue, ) -> Result<RowValue, String>
Convert one decoded result value into its public representation.
Source§fn format_input(
&self,
_: &FieldMeta,
value: &ScalarValue,
) -> Result<String, String>
fn format_input( &self, _: &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.
Source§fn fingerprint(&self) -> u64
fn fingerprint(&self) -> u64
Stable identity including codec configuration.
impl Copy for ScalarTextCodec
Auto Trait Implementations§
impl Freeze for ScalarTextCodec
impl RefUnwindSafe for ScalarTextCodec
impl Send for ScalarTextCodec
impl Sync for ScalarTextCodec
impl Unpin for ScalarTextCodec
impl UnsafeUnpin for ScalarTextCodec
impl UnwindSafe for ScalarTextCodec
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