Trait mule::Typer [−][src]
Infer the type of a raw value
Associated Types
type TypeTag: Display + Hash + Eq + Copy
[src]
Uniquely-identifying tag type for typed values
type Output: TypedValue<Self::TypeTag>
[src]
The type of a fully-typed single value
Required methods
fn type_value(&self, value: &RawValue) -> Self::Output
[src]
Parse a raw value into a specialized typed value
This method should never fail. Your type should have a fallback variant to be used when no appropriate concrete was detected (like a Text variant).
fn type_value_as(
&self,
value: &RawValue,
tag: Self::TypeTag
) -> ColumnValue<Self::Output>
[src]
&self,
value: &RawValue,
tag: Self::TypeTag
) -> ColumnValue<Self::Output>
Parse a raw value into a specific type. This should fail by parsing into ColumnValue::Invalid
when the specified type tag could not be used to parse the raw value.
Implementors
impl Typer for DefaultTyper
[src]
type TypeTag = ValueType
type Output = Value
fn type_value(&self, value: &RawValue) -> Self::Output
[src]
fn type_value_as(
&self,
value: &RawValue,
tag: Self::TypeTag
) -> ColumnValue<Self::Output>
[src]
&self,
value: &RawValue,
tag: Self::TypeTag
) -> ColumnValue<Self::Output>