INNER CODE UNIT · Rust
next_sid
ekzhang/sshx · crates/sshx-core/src/lib.rs:71
pub fn next_sid(&self) -> Sid {
Sid(self.next_sid.fetch_add(1, Ordering::Relaxed))
}
/// Returns the next unique user ID.
pub fn next_uid(&self) -> Uid {
Uid(self.next_uid.fetch_add(1, Ordering::Relaxed))
}
/// Return the current internal values of the counter.
pub fn get_current_values(&self) -> (Sid, Uid) {
(
Sid(self.next_sid.load(Ordering::Relaxed)),
Uid(self.next_uid.load(Ordering::Relaxed)),
)
}
/// Set the internal values of the counter.