[−][src]Struct rubble::link::queue::Producer
Writing end of a packet queue.
Methods
impl Producer
[src]
pub fn has_space(&mut self, space: usize) -> bool
[src]
Queries whether there is a free contiguous chunk of memory of at least space
bytes.
pub fn free_space(&mut self) -> usize
[src]
Returns the size of the largest contiguous free space in the queue (in Bytes).
pub fn produce_with<E>(
&mut self,
f: impl FnOnce(&mut ByteWriter) -> Result<Llid, E>
) -> Result<(), E> where
E: From<Error>,
[src]
&mut self,
f: impl FnOnce(&mut ByteWriter) -> Result<Llid, E>
) -> Result<(), E> where
E: From<Error>,
Enqueue a new data channel PDU by passing a ByteWriter
to a closure.
The closure has to write the PDU payload into the ByteWriter
and must return the Llid
to
set in the header. The payload size is determined and written to the header automatically.
pub fn produce_pdu<L: ToBytes>(&mut self, payload: Pdu<L>) -> Result<(), Error>
[src]
Enqueues a data channel PDU.
Returns Error::Eof
when the queue does not have enough free space for both header and
payload.
pub fn produce_raw(
&mut self,
header: Header,
payload: &[u8]
) -> Result<(), Error>
[src]
&mut self,
header: Header,
payload: &[u8]
) -> Result<(), Error>
Enqueues a data channel PDU, where the payload is given as raw bytes.
The payload will not be checked for validity.
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,