rust-postgres/tokio-postgres/src/stmt.rs
2018-12-27 13:51:39 -05:00

25 lines
467 B
Rust

use crate::types::Type;
/// Information about a column of a Postgres query.
#[derive(Debug)]
pub struct Column {
name: String,
type_: Type,
}
impl Column {
pub(crate) fn new(name: String, type_: Type) -> Column {
Column { name, type_ }
}
/// Returns the name of the column.
pub fn name(&self) -> &str {
&self.name
}
/// Returns the type of the column.
pub fn type_(&self) -> &Type {
&self.type_
}
}