pub struct Vu {
pub request_config: Arc<RequestConfig>,
pub plain_headers: Arc<Vec<(String, String)>>,
pub template: Option<Arc<Template>>,
pub cancellation_token: CancellationToken,
pub result_tx: UnboundedSender<RequestRecord>,
pub budget: Option<Arc<AtomicUsize>>,
}Expand description
A virtual user. Owns its configuration and drives its own execution loop.
Call spawn to launch the VU as a Tokio task. The VU loops, making requests
as fast as it can until its budget is exhausted (fixed mode) or its
cancellation token fires (curve mode).
Fields§
§request_config: Arc<RequestConfig>§plain_headers: Arc<Vec<(String, String)>>Pre-converted header pairs shared across all VUs — avoids per-request allocation.
template: Option<Arc<Template>>§cancellation_token: CancellationToken§result_tx: UnboundedSender<RequestRecord>§budget: Option<Arc<AtomicUsize>>Optional request budget shared across all VUs in fixed-count mode.
Each VU atomically claims one unit before dispatching a request and stops
when the counter reaches zero. None means run until the cancellation
token is triggered (curve mode).
Implementations§
Auto Trait Implementations§
impl Freeze for Vu
impl !RefUnwindSafe for Vu
impl Send for Vu
impl Sync for Vu
impl Unpin for Vu
impl UnsafeUnpin for Vu
impl !UnwindSafe for Vu
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