pub trait PostgresEnum:
Send
+ Sync
+ Any {
// Required methods
fn enum_type_name(&self) -> &'static str;
fn as_enum(&self) -> &dyn PostgresEnum;
fn variant_name(&self) -> &'static str;
fn into_boxed(&self) -> Box<dyn PostgresEnum>;
fn try_from_str(value: &str) -> Result<Self, DrizzleError>
where Self: Sized;
}Expand description
Trait for PostgreSQL native enum types that can be used as dyn objects
Required Methods§
Sourcefn enum_type_name(&self) -> &'static str
fn enum_type_name(&self) -> &'static str
Get the enum type name for PostgreSQL
fn as_enum(&self) -> &dyn PostgresEnum
Sourcefn variant_name(&self) -> &'static str
fn variant_name(&self) -> &'static str
Get the string representation of this enum variant
Sourcefn into_boxed(&self) -> Box<dyn PostgresEnum>
fn into_boxed(&self) -> Box<dyn PostgresEnum>
Clone this enum as a boxed trait object
Sourcefn try_from_str(value: &str) -> Result<Self, DrizzleError>where
Self: Sized,
fn try_from_str(value: &str) -> Result<Self, DrizzleError>where
Self: Sized,
Try to create this enum from a string value