use crate::Payload;
use ::shared::TransportMessage;
use std::fmt::{Debug, Formatter};
#[derive(Debug)]
pub struct AssociationEvent(pub(crate) AssociationEventInner);
pub(crate) enum AssociationEventInner {
Datagram(TransportMessage<Payload>),
}
impl Debug for AssociationEventInner {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
f.debug_struct("AssociationEventInner")
.field("Datagram", &self)
.finish()
}
}
#[derive(Debug)]
pub struct EndpointEvent(pub(crate) EndpointEventInner);
impl EndpointEvent {
pub fn drained() -> Self {
Self(EndpointEventInner::Drained)
}
pub fn is_drained(&self) -> bool {
self.0 == EndpointEventInner::Drained
}
}
#[derive(Clone, Debug, Eq, PartialEq)]
pub(crate) enum EndpointEventInner {
Drained,
}
pub type AssociationId = u32;
#[derive(Debug, Copy, Clone)]
pub struct IssuedAid {
pub sequence: u64,
pub id: AssociationId,
}