use syn::{
Field,
Index,
};
use crate::{
field_attributes::FieldAttributes,
serde_attributes::SerdeAttributes,
};
#[must_use]
pub(crate) struct UnnamedField<'a> {
field: &'a Field,
index: Index,
attributes: FieldAttributes,
serde_attributes: SerdeAttributes,
}
impl<'a> UnnamedField<'a> {
#[inline(always)]
pub(crate) const fn new(
field: &'a Field,
index: Index,
attributes: FieldAttributes,
serde_attributes: SerdeAttributes,
) -> Self {
Self {
field,
index,
attributes,
serde_attributes,
}
}
#[inline(always)]
pub(crate) const fn field(&self) -> &'a Field {
self.field
}
#[inline(always)]
pub(crate) const fn index(&self) -> &Index {
&self.index
}
#[inline(always)]
pub(crate) const fn attributes(&self) -> &FieldAttributes {
&self.attributes
}
#[inline(always)]
pub(crate) const fn serde_attributes(&self) -> &SerdeAttributes {
&self.serde_attributes
}
}