pub struct TxRing<'a> { /* private fields */ }
Expand description
Tx DMA state
Implementations§
Source§impl<'ring> TxRing<'ring>
impl<'ring> TxRing<'ring>
Sourcepub fn next_entry_available(&self) -> bool
pub fn next_entry_available(&self) -> bool
If this returns true
, the next send
will succeed.
Sourcepub fn send_next<'borrow>(
&'borrow mut self,
length: usize,
packet_id: Option<PacketId>,
) -> Result<TxPacket<'borrow, 'ring>, TxError>
pub fn send_next<'borrow>( &'borrow mut self, length: usize, packet_id: Option<PacketId>, ) -> Result<TxPacket<'borrow, 'ring>, TxError>
Prepare a packet for sending.
Write the data that you wish to send to the buffer
represented by the returned TxPacket
by using it
as a slice.
When all data is copied into the TX buffer, use TxPacket::send()
to transmit it.
Sourcepub async fn prepare_packet<'borrow>(
&'borrow mut self,
length: usize,
packet_id: Option<PacketId>,
) -> TxPacket<'borrow, 'ring>
pub async fn prepare_packet<'borrow>( &'borrow mut self, length: usize, packet_id: Option<PacketId>, ) -> TxPacket<'borrow, 'ring>
Prepare a packet for sending.
Write the data that you wish to send to the buffer
represented by the returned TxPacket
by using it
as a slice.
When all data is copied into the TX buffer, use TxPacket::send()
to transmit it.
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Is the Tx DMA engine running?
Source§impl TxRing<'_>
impl TxRing<'_>
Sourcepub fn wait_for_timestamp(
&self,
packet_id: &PacketId,
) -> Result<Option<Timestamp>, PacketIdNotFound>
pub fn wait_for_timestamp( &self, packet_id: &PacketId, ) -> Result<Option<Timestamp>, PacketIdNotFound>
Blockingly wait untill the timestamp for the given ID is available.
Sourcepub fn poll_timestamp(
&self,
packet_id: &PacketId,
) -> Poll<Result<Option<Timestamp>, PacketIdNotFound>>
pub fn poll_timestamp( &self, packet_id: &PacketId, ) -> Poll<Result<Option<Timestamp>, PacketIdNotFound>>
Poll to check if the timestamp for the given ID is already available.
Auto Trait Implementations§
impl<'a> Freeze for TxRing<'a>
impl<'a> RefUnwindSafe for TxRing<'a>
impl<'a> Send for TxRing<'a>
impl<'a> Sync for TxRing<'a>
impl<'a> Unpin for TxRing<'a>
impl<'a> !UnwindSafe for TxRing<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more