Trait p25::data::params::PacketParams
[−]
[src]
pub trait PacketParams { fn block_bytes() -> usize; fn tail_bytes() -> usize; fn max_blocks() -> usize { ... } fn packet_bytes() -> usize { ... } fn blocks(bytes: usize) -> usize { ... } fn pads(bytes: usize) -> usize { ... } fn full_blocks(bytes: usize) -> usize { ... } }
Required Methods
fn block_bytes() -> usize
Number of data bytes in a normal block.
fn tail_bytes() -> usize
Number of data bytes in the tail block.
Provided Methods
fn max_blocks() -> usize
Maximum number of blocks in the packet, including the tail block.
fn packet_bytes() -> usize
Maximum number of data bytes in the packet.
fn blocks(bytes: usize) -> usize
Calculate the total number of data blocks (normal and tail) needed to hold the given amount of bytes.
fn pads(bytes: usize) -> usize
Calculate the number of pads needed for the tail block (and possibly second-to-last block) for the given amount of bytes.
fn full_blocks(bytes: usize) -> usize
Calculate the number of normal data blocks (tail block not included) needed to hold the given amount of bytes.
Implementors
impl PacketParams for ConfirmedParams
impl PacketParams for UnconfirmedParams