use crate::command::flyweight::Flyweight;
use crate::concurrent::atomic_buffer::AtomicBuffer;
use crate::utils::types::Index;
#[repr(C, packed(4))]
#[derive(Copy, Clone)]
pub(crate) struct SubscriptionReadyDefn {
correlation_id: i64,
channel_status_indicator_id: i32,
}
pub const SUBSCRIPTION_READY_LENGTH: Index = std::mem::size_of::<SubscriptionReadyDefn>() as Index;
pub(crate) struct SubscriptionReadyFlyweight {
flyweight: Flyweight<SubscriptionReadyDefn>,
}
impl SubscriptionReadyFlyweight {
pub fn new(buffer: AtomicBuffer, offset: Index) -> Self {
Self {
flyweight: Flyweight::new(buffer, offset),
}
}
#[inline]
pub fn correlation_id(&self) -> i64 {
unsafe { (*self.flyweight.m_struct).correlation_id }
}
#[inline]
pub fn channel_status_indicator_id(&self) -> i32 {
unsafe { (*self.flyweight.m_struct).channel_status_indicator_id }
}
}