pub struct SessionManager { /* private fields */ }Expand description
Manages LDP session lifecycle and caching.
Thread-safe: uses RwLock internally.
Implementations§
Source§impl SessionManager
impl SessionManager
Sourcepub fn new(client: LdpClient, config: LdpAdapterConfig) -> Self
pub fn new(client: LdpClient, config: LdpAdapterConfig) -> Self
Create a new session manager.
Sourcepub async fn get_or_establish(&self, url: &str) -> Result<LdpSession, String>
pub async fn get_or_establish(&self, url: &str) -> Result<LdpSession, String>
Get or establish a session for the given remote URL.
If an active, non-expired session exists, returns it. Otherwise, runs the full handshake sequence.
Sourcepub async fn touch(&self, url: &str)
pub async fn touch(&self, url: &str)
Mark a session as used (touch timestamp, increment task count).
Sourcepub async fn active_count(&self) -> usize
pub async fn active_count(&self) -> usize
Get the number of active sessions.
Trait Implementations§
Source§impl Clone for SessionManager
impl Clone for SessionManager
Source§fn clone(&self) -> SessionManager
fn clone(&self) -> SessionManager
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 SessionManager
impl !RefUnwindSafe for SessionManager
impl Send for SessionManager
impl Sync for SessionManager
impl Unpin for SessionManager
impl UnsafeUnpin for SessionManager
impl !UnwindSafe for SessionManager
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