pub struct QueryState {
pub query_id: [u8; 32],
pub query: String,
pub responses: HashMap<String, String>,
pub votes: HashMap<[u8; 32], usize>,
pub finalized: bool,
pub result: Option<String>,
pub created_at: u64,
}Expand description
Query state for agent consensus voting
Fields§
§query_id: [u8; 32]Query ID (hash of the query)
query: StringOriginal query content
responses: HashMap<String, String>Collected responses with agent IDs
votes: HashMap<[u8; 32], usize>Votes for each response (response_hash -> vote_count)
finalized: boolWhether consensus has been reached
result: Option<String>Final agreed response
created_at: u64Timestamp of query creation
Implementations§
Trait Implementations§
Source§impl Clone for QueryState
impl Clone for QueryState
Source§fn clone(&self) -> QueryState
fn clone(&self) -> QueryState
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 moreAuto Trait Implementations§
impl Freeze for QueryState
impl RefUnwindSafe for QueryState
impl Send for QueryState
impl Sync for QueryState
impl Unpin for QueryState
impl UnwindSafe for QueryState
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