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