use crate::cassandra::value::{Value, ValueType};
use std::fmt;
use std::fmt::Debug;
use std::fmt::Display;
use std::fmt::Formatter;
pub struct Field<'a> {
pub name: String,
pub value: Value<'a>,
}
impl Debug for Field<'_> {
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
write!(f, "{} Cassandra type", self.get_type())
}
}
impl Display for Field<'_> {
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
write!(f, "{} Cassandra type", self.get_type())
}
}
impl<'a> Field<'a> {
pub fn get_name(&self) -> String {
self.name.clone()
}
pub fn get_type(&self) -> ValueType {
self.value.get_type()
}
pub fn get_value(&self) -> &Value<'a> {
&self.value
}
}