chuchi_postgres/table/
info.rs

1use super::column::Column;
2
3#[derive(Debug, Clone)]
4pub struct Info {
5	data: Vec<Column>,
6}
7
8impl Info {
9	pub fn new(data: Vec<Column>) -> Self {
10		Self { data }
11	}
12
13	pub fn with_capacity(cap: usize) -> Self {
14		Self {
15			data: Vec::with_capacity(cap),
16		}
17	}
18
19	pub fn push(&mut self, col: Column) {
20		self.data.push(col);
21	}
22
23	pub fn data(&self) -> &Vec<Column> {
24		&self.data
25	}
26
27	pub fn names<'a>(
28		&'a self,
29	) -> impl ExactSizeIterator<Item = &'static str> + 'a {
30		self.data.iter().map(|v| v.name)
31	}
32}
33
34#[derive(Debug, Clone)]
35pub struct ValidateParamsError(pub String);