Examples on this page target source snapshot
7e5c198e, not a crates.io release. Use the current API guide to select the matching dependency.Choose the creation type
Usepolls().create for single or multiple selections. Use create_quiz with a correct option index for a quiz. Both return CreatedPoll and carry the secret and creator needed by later votes.
Keep the parent association
Save the creation message ID, destination, actual crypto creator and secret together. To rebuild a reference for an incoming poll, use itsInboundMessage::message_ref(), the original creator and a validated MessageSecret. A message reference by itself does not include the crypto secret.
When processing updates, decrypt_vote(ciphertext, &target, voter).await returns selected option hashes. Map hashes to the creation’s option names or use aggregate_votes for a tally. Preserve voter identity and update order when building a custom aggregate.