Skip to main content

PostgresEnum

Trait PostgresEnum 

Source
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§

Source

fn enum_type_name(&self) -> &'static str

Get the enum type name for PostgreSQL

Source

fn as_enum(&self) -> &dyn PostgresEnum

Source

fn variant_name(&self) -> &'static str

Get the string representation of this enum variant

Source

fn into_boxed(&self) -> Box<dyn PostgresEnum>

Clone this enum as a boxed trait object

Source

fn try_from_str(value: &str) -> Result<Self, DrizzleError>
where Self: Sized,

Try to create this enum from a string value

§Errors

Returns DrizzleError::ConversionError when value is not a valid variant name for this enum.

Trait Implementations§

Source§

impl Clone for Box<dyn PostgresEnum>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for &dyn PostgresEnum

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Debug for Box<dyn PostgresEnum>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for &dyn PostgresEnum

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq for Box<dyn PostgresEnum>

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§