pub struct Session {
pub id: SessionId,
pub kind: SessionKind,
pub value: SessionValue,
pub party_signups: HashMap<SessionPartyNumber, ClientId>,
pub occupied_party_numbers: Vec<SessionPartyNumber>,
pub finished: HashSet<u16>,
}Expand description
Session is subgroup of clients intended to be used for a specific purpose.
Fields§
§id: SessionIdUnique ID of the session.
kind: SessionKindSession kind
value: SessionValuePublic value associated to this session.
This value can be set at the moment of creation. It can be a message or transaction intended to be signed by the session.
party_signups: HashMap<SessionPartyNumber, ClientId>Map party number to client id, starting at 1.
occupied_party_numbers: Vec<SessionPartyNumber>Occupied party numbers, starting at 1.
finished: HashSet<u16>Party numbers of finished clients
Implementations§
Source§impl Session
impl Session
Sourcepub fn new(id: Uuid, kind: SessionKind, value: SessionValue) -> Self
pub fn new(id: Uuid, kind: SessionKind, value: SessionValue) -> Self
Creates a new session with the given parameters.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Session
impl<'de> Deserialize<'de> for Session
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Session
impl RefUnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl UnwindSafe for Session
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