pub struct ProxySession { /* private fields */ }Expand description
An explicit session with its own rotation policy and counters. Session clones share that session, while new sessions are independent. All sessions share node health, per-node capacity, and HTTP connection pools with their parent.
Implementations§
Source§impl ProxySession
impl ProxySession
Sourcepub fn acquire(&self) -> Result<ProxyLease>
pub fn acquire(&self) -> Result<ProxyLease>
Reserve an attempt using this session’s rotation sequence.
Sourcepub fn rotate(&self)
pub fn rotate(&self)
Rotate this session on its next acquisition without changing other sessions.
Sourcepub async fn execute(&self, request: Request) -> Result<Response>
pub async fn execute(&self, request: Request) -> Result<Response>
Execute once, with the same no-replay behavior as ProxyPool::execute.
Sourcepub async fn execute_with_failover(
&self,
request: Request,
max_attempts: NonZeroUsize,
) -> Result<Response>
pub async fn execute_with_failover( &self, request: Request, max_attempts: NonZeroUsize, ) -> Result<Response>
Explicit GET/HEAD/OPTIONS failover within this session.
Trait Implementations§
Source§impl Clone for ProxySession
impl Clone for ProxySession
Source§fn clone(&self) -> ProxySession
fn clone(&self) -> ProxySession
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 !RefUnwindSafe for ProxySession
impl !UnwindSafe for ProxySession
impl Freeze for ProxySession
impl Send for ProxySession
impl Sync for ProxySession
impl Unpin for ProxySession
impl UnsafeUnpin for ProxySession
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