pub struct StreamingPhysics { /* private fields */ }Expand description
Controls the timing physics of a streamed (SSE) completion
(mirrors org.mockserver.model.StreamingPhysics).
timeToFirstToken serialises as a Delay: { timeUnit, value }.
Implementations§
Source§impl StreamingPhysics
impl StreamingPhysics
Sourcepub fn with_time_to_first_token(
self,
value: i64,
time_unit: impl Into<String>,
) -> Self
pub fn with_time_to_first_token( self, value: i64, time_unit: impl Into<String>, ) -> Self
Set time-to-first-token as a delay value with the given time unit
(e.g. "MILLISECONDS").
Sourcepub fn with_tokens_per_second(self, tokens_per_second: i64) -> Self
pub fn with_tokens_per_second(self, tokens_per_second: i64) -> Self
Set tokens-per-second (must be in [1, 10000]).
§Panics
Panics if tokens_per_second is outside 1..=10000.
Sourcepub fn with_jitter(self, jitter: f64) -> Self
pub fn with_jitter(self, jitter: f64) -> Self
Trait Implementations§
Source§impl Clone for StreamingPhysics
impl Clone for StreamingPhysics
Source§fn clone(&self) -> StreamingPhysics
fn clone(&self) -> StreamingPhysics
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 moreSource§impl Debug for StreamingPhysics
impl Debug for StreamingPhysics
Source§impl Default for StreamingPhysics
impl Default for StreamingPhysics
Source§fn default() -> StreamingPhysics
fn default() -> StreamingPhysics
Returns the “default value” for a type. Read more
Source§impl PartialEq for StreamingPhysics
impl PartialEq for StreamingPhysics
Source§fn eq(&self, other: &StreamingPhysics) -> bool
fn eq(&self, other: &StreamingPhysics) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for StreamingPhysics
Auto Trait Implementations§
impl Freeze for StreamingPhysics
impl RefUnwindSafe for StreamingPhysics
impl Send for StreamingPhysics
impl Sync for StreamingPhysics
impl Unpin for StreamingPhysics
impl UnsafeUnpin for StreamingPhysics
impl UnwindSafe for StreamingPhysics
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