pub struct StringCodec {
pub name: &'static str,
pub field: &'static str,
pub trim: bool,
}Expand description
A strict text field codec with optional whitespace normalization. It is useful when an API’s representation must be explicit even though the underlying value is already a SQL text column.
Fields§
§name: &'static str§field: &'static str§trim: boolTrait Implementations§
Source§impl Clone for StringCodec
impl Clone for StringCodec
Source§impl Codec for StringCodec
impl Codec for StringCodec
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 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.
impl Copy for StringCodec
Auto Trait Implementations§
impl Freeze for StringCodec
impl RefUnwindSafe for StringCodec
impl Send for StringCodec
impl Sync for StringCodec
impl Unpin for StringCodec
impl UnsafeUnpin for StringCodec
impl UnwindSafe for StringCodec
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