rust-postgres/tokio-postgres/src/stmt.rs

29 lines
518 B
Rust
Raw Normal View History

2016-12-26 21:29:30 +00:00
use types::Type;
2017-07-22 04:08:39 +00:00
/// Information about a column of a Postgres query.
#[derive(Debug)]
2016-12-26 21:29:30 +00:00
pub struct Column {
name: String,
type_: Type,
}
impl Column {
#[doc(hidden)]
pub fn new(name: String, type_: Type) -> Column {
Column {
name: name,
type_: type_,
}
}
2017-07-22 04:08:39 +00:00
/// Returns the name of the column.
2016-12-26 21:29:30 +00:00
pub fn name(&self) -> &str {
&self.name
}
2017-07-22 04:08:39 +00:00
/// Returns the type of the column.
2016-12-26 21:29:30 +00:00
pub fn type_(&self) -> &Type {
&self.type_
}
}