Struct async_rustbus::rustbus_core::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 remaining params signature (if any are left)

Get the next param, use get:: to specify what type you expect. For example 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

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.