pub struct BundleElementWriter<'a> { /* private fields */ }Expand description
The structure used to write elements to a bundle. This structure
Implementations§
Source§impl<'a> BundleElementWriter<'a>
impl<'a> BundleElementWriter<'a>
Sourcepub fn write<E: TopElement>(&mut self, id: u8, element: E, config: &E::Config)
pub fn write<E: TopElement>(&mut self, id: u8, element: E, config: &E::Config)
Add an element to this bundle.
Sourcepub fn write_simple<E: TopElement<Config = ()>>(&mut self, id: u8, element: E)
pub fn write_simple<E: TopElement<Config = ()>>(&mut self, id: u8, element: E)
Add a simple element to this bundle. Such elements have no config.
Sourcepub fn write_request<E: TopElement>(
&mut self,
id: u8,
element: E,
config: &E::Config,
request_id: u32,
)
pub fn write_request<E: TopElement>( &mut self, id: u8, element: E, config: &E::Config, request_id: u32, )
Add a request element to this bundle, with a given request ID.
Sourcepub fn write_simple_request<E: TopElement<Config = ()>>(
&mut self,
id: u8,
element: E,
request_id: u32,
)
pub fn write_simple_request<E: TopElement<Config = ()>>( &mut self, id: u8, element: E, request_id: u32, )
Add a request element to this bundle, with a given request ID. Such elements have no config.
Sourcepub fn write_reply<E: Element>(
&mut self,
element: E,
config: &E::Config,
request_id: u32,
)
pub fn write_reply<E: Element>( &mut self, element: E, config: &E::Config, request_id: u32, )
Add a reply element to this bundle, for a given request ID.
Such elements are special and don’t require an ID, because they are always of a 32-bit variable length and prefixed with the request ID.
Sourcepub fn write_simple_reply<E: Element<Config = ()>>(
&mut self,
element: E,
request_id: u32,
)
pub fn write_simple_reply<E: Element<Config = ()>>( &mut self, element: E, request_id: u32, )
Add a reply element to this bundle, for a given request ID. Such elements have no config.
Sourcepub fn write_raw<E: TopElement>(
&mut self,
element: BundleElement<E>,
config: &E::Config,
)
pub fn write_raw<E: TopElement>( &mut self, element: BundleElement<E>, config: &E::Config, )
Raw method to add an element to this bundle, given an ID, the element and its config. With an optional request ID.
Auto Trait Implementations§
impl<'a> Freeze for BundleElementWriter<'a>
impl<'a> RefUnwindSafe for BundleElementWriter<'a>
impl<'a> Send for BundleElementWriter<'a>
impl<'a> Sync for BundleElementWriter<'a>
impl<'a> Unpin for BundleElementWriter<'a>
impl<'a> !UnwindSafe for BundleElementWriter<'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