use crate::Value;
use std::collections::HashMap;
use std::rc::Rc;
#[derive(Debug)]
pub struct GpkgAttributeRow {
pub(super) id: i64,
pub(super) properties: Vec<Value>,
pub(super) property_index_by_name: Rc<HashMap<String, usize>>,
}
impl GpkgAttributeRow {
pub fn id(&self) -> i64 {
self.id
}
pub fn property(&self, name: &str) -> Option<Value> {
let idx = *self.property_index_by_name.get(name)?;
Some(self.properties[idx].clone())
}
pub fn properties(&self) -> &[Value] {
&self.properties
}
}