adding more packet info getter
This commit is contained in:
parent
f7e55f2b0b
commit
7a94058e36
@ -132,7 +132,7 @@ impl Connection<side::Client> {
|
|||||||
|
|
||||||
let mut send = self.conn.open_uni().await?;
|
let mut send = self.conn.open_uni().await?;
|
||||||
model.header().async_marshal(&mut send).await?;
|
model.header().async_marshal(&mut send).await?;
|
||||||
send.close().await?;
|
send.close().await?; // stuck here
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -479,6 +479,21 @@ impl Packet {
|
|||||||
self.model.assoc_id()
|
self.model.assoc_id()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns the packet ID
|
||||||
|
pub fn pkt_id(&self) -> u16 {
|
||||||
|
self.model.pkt_id()
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Returns the fragment ID
|
||||||
|
pub fn frag_id(&self) -> u8 {
|
||||||
|
self.model.frag_id()
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Returns the total number of fragments
|
||||||
|
pub fn frag_total(&self) -> u8 {
|
||||||
|
self.model.frag_total()
|
||||||
|
}
|
||||||
|
|
||||||
/// Accepts the packet payload. If the packet is fragmented and not yet fully assembled, `Ok(None)` is returned.
|
/// Accepts the packet payload. If the packet is fragmented and not yet fully assembled, `Ok(None)` is returned.
|
||||||
pub async fn accept(self) -> Result<Option<(Bytes, Address, u16)>, Error> {
|
pub async fn accept(self) -> Result<Option<(Bytes, Address, u16)>, Error> {
|
||||||
let pkt = match self.src {
|
let pkt = match self.src {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user