pub struct Bundle { /* private fields */ }Expand description
A bundle is a sequence of packets that are used to store elements. Elements of various types, like regular elements, requests or replies can be simply added and the number of packets contained in this bundle is automatically adjusted if no more space is available.
Functions that are used to add elements provide a builder-like structure by returning a mutable reference to itself.
Implementations§
Source§impl Bundle
impl Bundle
Sourcepub fn new() -> Bundle
pub fn new() -> Bundle
Construct a new empty bundle, this bundle doesn’t allocate until you add the first element.
Sourcepub fn with_single(packet: Box<Packet>) -> Self
pub fn with_single(packet: Box<Packet>) -> Self
Create a new bundle with one predefined packet.
Sourcepub fn with_multiple(packets: Vec<Box<Packet>>) -> Self
pub fn with_multiple(packets: Vec<Box<Packet>>) -> Self
Create a new bundle with multiple predefined packets.
Sourcepub fn element_reader(&self) -> BundleElementReader<'_>
pub fn element_reader(&self) -> BundleElementReader<'_>
See BundleElementReader.
Sourcepub fn element_writer(&mut self) -> BundleElementWriter<'_>
pub fn element_writer(&mut self) -> BundleElementWriter<'_>
See BundleElementWriter.
pub fn is_empty(&self) -> bool
pub fn packets_mut(&mut self) -> &mut [Box<Packet>]
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Bundle
impl RefUnwindSafe for Bundle
impl Send for Bundle
impl Sync for Bundle
impl Unpin for Bundle
impl UnwindSafe for Bundle
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