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 DecisionState
impl BorshDeserialize for DecisionState
Source§impl BorshSerialize for DecisionState
impl BorshSerialize for DecisionState
Source§impl Clone for DecisionState
impl Clone for DecisionState
Source§fn clone(&self) -> DecisionState
fn clone(&self) -> DecisionState
Returns a duplicate 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
impl Eq for DecisionState
impl StructuralPartialEq for DecisionState
Auto Trait Implementations§
impl Freeze for DecisionState
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