Struct rustbus::message_builder::MessageBodyParser [−][src]
pub struct MessageBodyParser<'body> { /* fields omitted */ }
Expand description
Iterate over the messages parameters
Because dbus allows for multiple toplevel params without an enclosing struct, this provides a simple Iterator (sadly not std::iterator::Iterator, since the types
of the parameters can be different)
that you can use to get the params one by one, calling get::<T>
until you have obtained all the parameters.
If you try to get more parameters than the signature has types, it will return None, if you try to get a parameter that doesn not
fit the current one, it will return an Error::WrongSignature, but you can safely try other types, the iterator stays valid.
Implementations
Get the next params signature (if any are left)
Get the next param, use get::let s = parser.get::<String>()?;
This checks if there are params left in the message and if the type you requested fits the signature of the message.
Get the next two params, use get2::<TYPE, TYPE> to specify what type you expect. For example let s = parser.get2::<String, i32>()?;
This checks if there are params left in the message and if the type you requested fits the signature of the message.
Get the next three params, use get3::<TYPE, TYPE, TYPE> to specify what type you expect. For example let s = parser.get3::<String, i32, u64>()?;
This checks if there are params left in the message and if the type you requested fits the signature of the message.
Get the next four params, use get4::<TYPE, TYPE, TYPE, TYPE> to specify what type you expect. For example let s = parser.get4::<String, i32, u64, u8>()?;
This checks if there are params left in the message and if the type you requested fits the signature of the message.
Get the next five params, use get5::<TYPE, TYPE, TYPE, TYPE, TYPE> to specify what type you expect. For example let s = parser.get4::<String, i32, u64, u8, bool>()?;
This checks if there are params left in the message and if the type you requested fits the signature of the message.
Trait Implementations
Auto Trait Implementations
impl<'body> RefUnwindSafe for MessageBodyParser<'body>
impl<'body> Send for MessageBodyParser<'body>
impl<'body> Sync for MessageBodyParser<'body>
impl<'body> Unpin for MessageBodyParser<'body>
impl<'body> UnwindSafe for MessageBodyParser<'body>