pub struct Sessions<'a> { /* private fields */ }Expand description
The sessions namespace. Obtain via Client::sessions.
Implementations§
Source§impl Sessions<'_>
impl Sessions<'_>
Sourcepub async fn create(
&self,
options: CreateSessionOptions,
) -> Result<Session, SolariError>
pub async fn create( &self, options: CreateSessionOptions, ) -> Result<Session, SolariError>
POST /sessions — acquire a browser session.
Sourcepub async fn get(&self, id: &str) -> Result<SessionView, SolariError>
pub async fn get(&self, id: &str) -> Result<SessionView, SolariError>
GET /sessions/:id.
Sourcepub async fn release(&self, id: &str) -> Result<(), SolariError>
pub async fn release(&self, id: &str) -> Result<(), SolariError>
DELETE /sessions/:id — release the session. A bare 404 is tolerated
(the session already ended).
A 404 carrying SolariErrorCode::InvalidSessionId is an error. The
gateway acks 204 for any authentic session id, including one whose
session has already ended — the handler is idempotent by design and never
consults the pool before acking. So a 404 does not mean “already
released”; it means the gateway refused the id (malformed, forged, or
another org’s) and released nothing, leaving the pool slot held until
orphan-grace. Treating that as success is what made these releases leak
slots silently.
A bare 404 with no code stays tolerated — that is a pre-InvalidSessionId
gateway, where a 404 may legitimately mean the session is already gone.
Mirrors releaseRejection in sdk/src/index.ts.
Unlike the TS SDK there is no fire-and-forget variant; this is the
equivalent of releaseAndWait. Spawn it yourself if you don’t want to
await the round-trip.
Sourcepub async fn replay_url(&self, id: &str) -> Result<ReplayUrl, SolariError>
pub async fn replay_url(&self, id: &str) -> Result<ReplayUrl, SolariError>
GET /sessions/:id/replay-url — presigned URL for the session’s replay.
Available ~1-3s after Sessions::release.
Sourcepub async fn download_replay(&self, id: &str) -> Result<Vec<u8>, SolariError>
pub async fn download_replay(&self, id: &str) -> Result<Vec<u8>, SolariError>
Download the session’s replay as NDJSON bytes. May or may not
actually be gzip despite what was uploaded — GCS decompresses
transparently on an ordinary GET, so check content_encoding (now
provider-accurate) before attempting to decompress.