use super::IndexState;
#[derive(Clone, Debug, Eq, PartialEq)]
#[must_use = "the owned entry contains a removed or replaced record"]
pub struct OwnedEntry<K, O, V> {
pub(crate) key: K,
pub(crate) order: O,
pub(crate) value: V,
pub(crate) state: IndexState,
}
impl<K, O, V> OwnedEntry<K, O, V> {
#[must_use]
#[inline]
pub const fn key(&self) -> &K {
&self.key
}
#[must_use]
#[inline]
pub const fn order(&self) -> &O {
&self.order
}
#[must_use]
#[inline]
pub const fn value(&self) -> &V {
&self.value
}
#[must_use]
#[inline]
pub fn value_mut(&mut self) -> &mut V {
&mut self.value
}
#[must_use = "the attachment state describes the record before removal"]
#[inline]
pub const fn state(&self) -> IndexState {
self.state
}
#[must_use]
#[inline]
pub fn into_key(self) -> K {
self.key
}
#[must_use]
#[inline]
pub fn into_order(self) -> O {
self.order
}
#[must_use]
#[inline]
pub fn into_value(self) -> V {
self.value
}
#[must_use = "the returned components contain the complete removed record"]
#[inline]
pub fn into_parts(self) -> (K, O, V, IndexState) {
(self.key, self.order, self.value, self.state)
}
}