24 lines
418 B
Rust
24 lines
418 B
Rust
#[derive(Clone, Copy, PartialEq)]
|
|
pub enum SessionState {
|
|
Anonymous,
|
|
User,
|
|
}
|
|
|
|
pub struct Session {
|
|
pub state:SessionState,
|
|
pub handle:String,
|
|
pub token:[u8; 8],
|
|
pub secret:[u8; 16],
|
|
}
|
|
impl Session {
|
|
pub fn new() -> Self
|
|
{
|
|
Self {
|
|
state:SessionState::Anonymous,
|
|
handle:String::new(),
|
|
token:[0; 8],
|
|
secret:[0; 16],
|
|
}
|
|
}
|
|
}
|