mirror of
https://github.com/librespot-org/librespot.git
synced 2024-12-18 17:11:53 +00:00
core API: SessionInternal
This commit is contained in:
parent
0fd398e34d
commit
aed4fe32d8
1 changed files with 3 additions and 3 deletions
|
@ -24,7 +24,7 @@ struct SessionData {
|
||||||
canonical_username: String,
|
canonical_username: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct SessionInternal {
|
struct SessionInternal {
|
||||||
config: SessionConfig,
|
config: SessionConfig,
|
||||||
data: RwLock<SessionData>,
|
data: RwLock<SessionData>,
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ pub struct SessionInternal {
|
||||||
static SESSION_COUNTER: AtomicUsize = ATOMIC_USIZE_INIT;
|
static SESSION_COUNTER: AtomicUsize = ATOMIC_USIZE_INIT;
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct Session(pub Arc<SessionInternal>);
|
pub struct Session(Arc<SessionInternal>);
|
||||||
|
|
||||||
pub fn device_id(name: &str) -> String {
|
pub fn device_id(name: &str) -> String {
|
||||||
let mut h = Sha1::new();
|
let mut h = Sha1::new();
|
||||||
|
@ -226,7 +226,7 @@ impl Session {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct SessionWeak(pub Weak<SessionInternal>);
|
pub struct SessionWeak(Weak<SessionInternal>);
|
||||||
|
|
||||||
impl SessionWeak {
|
impl SessionWeak {
|
||||||
fn try_upgrade(&self) -> Option<Session> {
|
fn try_upgrade(&self) -> Option<Session> {
|
||||||
|
|
Loading…
Reference in a new issue