Struct async_rustbus::rustbus_core::message_builder::MarshalledMessageBody [−][src]
pub struct MarshalledMessageBody { /* fields omitted */ }
Expand description
The body accepts everything that implements the Marshal trait (e.g. all basic types, strings, slices, Hashmaps,…..) And you can of course write an Marshal impl for your own datastrcutures
Implementations
New messagebody with a chosen byteorder
pub fn from_parts(
buf: Vec<u8>,
raw_fds: Vec<UnixFd>,
sig: SignatureBuffer,
byteorder: ByteOrder
) -> Self
Get a clone of all the UnixFd
s in the body.
Some of the UnixFd
s may already have their RawFd
s taken.
Clears the buffer and signature but holds on to the memory allocations. You can now start pushing new params as if this were a new message. This allows to reuse the OutMessage for the same dbus-message with different parameters without allocating the buffer every time.
Reserves space for additional
bytes in the internal buffer. This is useful to reduce the amount of allocations done while marshalling,
if you can predict somewhat accuratly how many bytes you will be marshalling.
pub fn push_param_helper<F>(&mut self, push_fn: F) -> Result<(), Error> where
F: FnOnce(&mut MarshalContext<'_, '_>, &mut SignatureBuffer) -> Result<(), Error>,
Append something that is Marshal to the message body
Append two things that are Marshal to the message body
Append three things that are Marshal to the message body
Append four things that are Marshal to the message body
Append five things that are Marshal to the message body
Append any number of things that have the same type that is Marshal to the message body
Append something that is Marshal to the body but use a dbus Variant in the signature. This is necessary for some APIs
Validate the all the marshalled elements of the body.
Create a parser to retrieve parameters from the body.