Struct race_api::decision::DecisionState
source · pub struct DecisionState {
pub id: DecisionId,
/* private fields */
}Fields§
§id: DecisionIdImplementations§
source§impl DecisionState
impl DecisionState
pub fn new(id: DecisionId, owner: String) -> Self
pub fn answer( &mut self, owner: &str, ciphertext: Ciphertext, digest: SecretDigest ) -> Result<()>
pub fn release(&mut self) -> Result<()>
sourcepub fn add_released(&mut self, value: String) -> Result<()>
pub fn add_released(&mut self, value: String) -> Result<()>
Add the decryption result.
So that it can be read inside the game handler.
sourcepub fn add_secret(&mut self, owner: &str, secret: SecretKey) -> Result<()>
pub fn add_secret(&mut self, owner: &str, secret: SecretKey) -> Result<()>
Add the shared secret and update the status.
The secret will be used to decrypt the answer.
pub fn get_secret(&self) -> Result<&SecretKey>
pub fn is_answered(&self) -> bool
pub fn is_prompted(&self) -> bool
pub fn is_revealed(&self) -> bool
pub fn is_revealing(&self) -> bool
pub fn get_answer(&self) -> Option<&Answer>
pub fn get_revealed(&self) -> Option<&String>
pub fn get_owner(&self) -> &str
Trait Implementations§
source§impl BorshDeserialize for DecisionStatewhere
DecisionId: BorshDeserialize,
String: BorshDeserialize,
DecisionStatus: BorshDeserialize,
Option<Answer>: BorshDeserialize,
Option<SecretKey>: BorshDeserialize,
Option<String>: BorshDeserialize,
impl BorshDeserialize for DecisionStatewhere DecisionId: BorshDeserialize, String: BorshDeserialize, DecisionStatus: BorshDeserialize, Option<Answer>: BorshDeserialize, Option<SecretKey>: BorshDeserialize, Option<String>: BorshDeserialize,
source§impl BorshSerialize for DecisionStatewhere
DecisionId: BorshSerialize,
String: BorshSerialize,
DecisionStatus: BorshSerialize,
Option<Answer>: BorshSerialize,
Option<SecretKey>: BorshSerialize,
Option<String>: BorshSerialize,
impl BorshSerialize for DecisionStatewhere DecisionId: BorshSerialize, String: BorshSerialize, DecisionStatus: BorshSerialize, Option<Answer>: BorshSerialize, Option<SecretKey>: BorshSerialize, Option<String>: BorshSerialize,
source§impl Clone for DecisionState
impl Clone for DecisionState
source§fn clone(&self) -> DecisionState
fn clone(&self) -> DecisionState
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for DecisionState
impl Debug for DecisionState
source§impl PartialEq for DecisionState
impl PartialEq for DecisionState
source§fn eq(&self, other: &DecisionState) -> bool
fn eq(&self, other: &DecisionState) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl Eq for DecisionState
impl StructuralEq for DecisionState
impl StructuralPartialEq for DecisionState
Auto Trait Implementations§
impl RefUnwindSafe for DecisionState
impl Send for DecisionState
impl Sync for DecisionState
impl Unpin for DecisionState
impl UnwindSafe for DecisionState
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more