pub struct CustomValue {
pub type_tag: String,
pub encoded: Vec<u8>,
pub display: String,
}Expand description
A type-erased representation of a custom data type value.
CustomValue holds the binary encoding and cached display string for
a user-defined data type, along with a type tag that identifies the
concrete type. This allows the DBMS engine to compare, order, hash,
and display custom values without knowing their concrete types.
Fields§
§type_tag: StringType identifier from CustomDataType::TYPE_TAG.
encoded: Vec<u8>Binary encoding via the concrete type’s Encode impl.
display: StringCached Display output for human-readable representation.
Implementations§
Source§impl CustomValue
impl CustomValue
Sourcepub fn new<T: CustomDataType>(value: &T) -> Self
pub fn new<T: CustomDataType>(value: &T) -> Self
Creates a new CustomValue from a concrete CustomDataType.
This constructor ensures consistency between the type tag, encoded bytes, and display string by deriving all three from the concrete value.
Trait Implementations§
Source§impl Clone for CustomValue
impl Clone for CustomValue
Source§fn clone(&self) -> CustomValue
fn clone(&self) -> CustomValue
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CustomValue
impl Debug for CustomValue
Source§impl<'de> Deserialize<'de> for CustomValue
impl<'de> Deserialize<'de> for CustomValue
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for CustomValue
impl Display for CustomValue
Source§impl Hash for CustomValue
impl Hash for CustomValue
Source§impl Ord for CustomValue
impl Ord for CustomValue
Source§impl PartialEq for CustomValue
impl PartialEq for CustomValue
Source§impl PartialOrd for CustomValue
impl PartialOrd for CustomValue
Source§impl Serialize for CustomValue
impl Serialize for CustomValue
impl Eq for CustomValue
Auto Trait Implementations§
impl Freeze for CustomValue
impl RefUnwindSafe for CustomValue
impl Send for CustomValue
impl Sync for CustomValue
impl Unpin for CustomValue
impl UnsafeUnpin for CustomValue
impl UnwindSafe for CustomValue
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