pub struct CallApi<'api> { /* private fields */ }

Implementations

Attach a corporate ballot to the CA identified by ca_id.

The ballot will admit votes within range. The ballot’s metadata is provided by meta, which includes the ballot title, the motions, their choices, etc. See the BallotMeta for more.

Arguments
  • origin is a signer that has permissions to act as an agent of ca_id.ticker.
  • ca_id identifies the CA to attach the ballot to.
  • range specifies when voting starts and ends.
  • meta specifies the ballot’s metadata as aforementioned.
  • rcv specifies whether RCV is enabled for this ballot.
Errors
  • UnauthorizedAgent if origin is not agent-permissioned for ticker.
  • NoSuchCA if ca_id does not identify an existing CA.
  • CANotNotice if the CA is not of the IssuerNotice kind.
  • StartAfterEnd if range.start > range.end.
  • NowAfterEnd if now > range.end where now is the current timestamp.
  • NoRecordDate if CA has no record date.
  • RecordDateAfterStart if date > range.start where date is the CA’s record date.
  • AlreadyExists if there’s a ballot already.
  • NumberOfChoicesOverflow if the total choice in meta overflows usize.
  • TooLong if any of the embedded strings in meta are too long.
  • InsufficientBalance if the protocol fee couldn’t be charged.

Cast votes in the ballot attached to the CA identified by ca_id.

Arguments
  • origin which must be a permissioned signer targeted by the CA.
  • ca_id identifies the attached ballot’s CA.
  • votes specifies the balances to assign to each choice in the ballot. The full voting power of origin’s DID may be used for each motion in the ballot.
Errors
  • NoSuchBallot if ca_id does not identify a ballot.
  • VotingNotStarted if the voting period hasn’t commenced yet.
  • VotingAlreadyEnded if the voting period has ended.
  • WrongVoteCount if the number of choices in the ballot does not match votes.len().
  • NoSuchCA if ca_id does not identify an existing CA.
  • NotTargetedByCA if the CA does not target origin’s DID.
  • InsufficientVotes if the voting power used for any motion in votes exceeds origin’s DID’s voting power.

Amend the end date of the ballot of the CA identified by ca_id.

Arguments
  • origin is a signer that has permissions to act as an agent of ca_id.ticker.
  • ca_id identifies the attached ballot’s CA.
  • end specifies the new end date of the ballot.
Errors
  • UnauthorizedAgent if origin is not agent-permissioned for ticker.
  • NoSuchBallot if ca_id does not identify a ballot.
  • VotingAlreadyStarted if start >= now, where now is the current time.
  • StartAfterEnd if start > end.

Amend the metadata (title, motions, etc.) of the ballot of the CA identified by ca_id.

Arguments
  • origin is a signer that has permissions to act as an agent of ca_id.ticker.
  • ca_id identifies the attached ballot’s CA.
  • meta specifies the new metadata.
Errors
  • UnauthorizedAgent if origin is not agent-permissioned for ticker.
  • NoSuchBallot if ca_id does not identify a ballot.
  • VotingAlreadyStarted if start >= now, where now is the current time.
  • NumberOfChoicesOverflow if the total choice in meta overflows usize.
  • TooLong if any of the embedded strings in meta are too long.

Amend RCV support for the ballot of the CA identified by ca_id.

Arguments
  • origin is a signer that has permissions to act as an agent of ca_id.ticker.
  • ca_id identifies the attached ballot’s CA.
  • rcv specifies if RCV is to be supported or not.
Errors
  • UnauthorizedAgent if origin is not agent-permissioned for ticker.
  • NoSuchBallot if ca_id does not identify a ballot.
  • VotingAlreadyStarted if start >= now, where now is the current time.

Remove the ballot of the CA identified by ca_id.

Arguments
  • origin is a signer that has permissions to act as an agent of ca_id.ticker.
  • ca_id identifies the attached ballot’s CA.
Errors
  • UnauthorizedAgent if origin is not agent-permissioned for ticker.
  • NoSuchBallot if ca_id does not identify a ballot.
  • VotingAlreadyStarted if start >= now, where now is the current time.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Converts to this type from the input type.

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
Convert from a value of T into an equivalent instance of Option<Self>. Read more
Consume self to return Some equivalent value of Option<T>. Read more
Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more
Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more
Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more
Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more
Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Get a reference to the inner from the outer.

Get a mutable reference to the inner from the outer.

Should always be Self
Convert from a value of T into an equivalent instance of Self. Read more
Consume self to return an equivalent value of T. Read more
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
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.
The counterpart to unchecked_from.
Consume self to return an equivalent value of T.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more