Add Hash implementation to Type
This commit is contained in:
parent
a22f63b5bb
commit
edd9a5aa7f
@ -266,7 +266,7 @@ use std::sync::Arc;
|
||||
|
||||
use crate::{{Type, Oid, Kind}};
|
||||
|
||||
#[derive(PartialEq, Eq, Debug)]
|
||||
#[derive(PartialEq, Eq, Debug, Hash)]
|
||||
pub struct Other {{
|
||||
pub name: String,
|
||||
pub oid: Oid,
|
||||
@ -282,7 +282,7 @@ fn make_enum(w: &mut BufWriter<File>, types: &BTreeMap<u32, Type>) {
|
||||
write!(
|
||||
w,
|
||||
"
|
||||
#[derive(PartialEq, Eq, Clone, Debug)]
|
||||
#[derive(PartialEq, Eq, Clone, Debug, Hash)]
|
||||
pub enum Inner {{"
|
||||
)
|
||||
.unwrap();
|
||||
|
@ -209,7 +209,7 @@ mod special;
|
||||
mod type_gen;
|
||||
|
||||
/// A Postgres type.
|
||||
#[derive(PartialEq, Eq, Clone, Debug)]
|
||||
#[derive(PartialEq, Eq, Clone, Debug, Hash)]
|
||||
pub struct Type(Inner);
|
||||
|
||||
impl fmt::Display for Type {
|
||||
@ -264,7 +264,7 @@ impl Type {
|
||||
}
|
||||
|
||||
/// Represents the kind of a Postgres type.
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||
pub enum Kind {
|
||||
/// A simple type like `VARCHAR` or `INTEGER`.
|
||||
Simple,
|
||||
@ -285,7 +285,7 @@ pub enum Kind {
|
||||
}
|
||||
|
||||
/// Information about a field of a composite type.
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||
pub struct Field {
|
||||
name: String,
|
||||
type_: Type,
|
||||
|
@ -3,7 +3,7 @@ use std::sync::Arc;
|
||||
|
||||
use crate::{Kind, Oid, Type};
|
||||
|
||||
#[derive(PartialEq, Eq, Debug)]
|
||||
#[derive(PartialEq, Eq, Debug, Hash)]
|
||||
pub struct Other {
|
||||
pub name: String,
|
||||
pub oid: Oid,
|
||||
@ -11,7 +11,7 @@ pub struct Other {
|
||||
pub schema: String,
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Eq, Clone, Debug)]
|
||||
#[derive(PartialEq, Eq, Clone, Debug, Hash)]
|
||||
pub enum Inner {
|
||||
Bool,
|
||||
Bytea,
|
||||
|
Loading…
Reference in New Issue
Block a user