pub struct StaticRwndConfig {
pub duration: Option<Duration>,
pub set_rcv_buf: Option<u64>,
pub app_read_bytes: Option<u64>,
}Expand description
The configuration struct for StaticRwnd.
The serialized JSON form is flat: a step looks like
{"duration":"1s","set_rcv_buf":65536} or
{"duration":"1s","app_read_bytes":1024}, and may carry both keys.
The two fields are independent – there is no invariant to enforce, so
Serialize/Deserialize are derived. A step with neither field is valid and
carries the previous configuration forward.
Unknown keys are rejected rather than ignored. The schema dropped
rwnd_remaining, and serde’s default of skipping what it does not recognise
would turn a trace written against the old schema into a run of steps that
state nothing – a replay that looks healthy while reproducing no receiver at
all. Failing to deserialize names the offending field instead.
Fields§
§duration: Option<Duration>§set_rcv_buf: Option<u64>§app_read_bytes: Option<u64>Implementations§
Source§impl StaticRwndConfig
impl StaticRwndConfig
pub fn new() -> Self
pub fn duration(self, duration: Duration) -> Self
Sourcepub fn set_rcv_buf(self, set_rcv_buf: u64) -> Self
pub fn set_rcv_buf(self, set_rcv_buf: u64) -> Self
Size the receive buffer.
On its own this also holds the advertised window at that value, with the
application draining continuously. Combined with Self::app_read it
only sets the size: the resize applies first, the read is taken against
the new size, and the window then follows set_rcv_buf - unread rather
than being pinned.
Sourcepub fn app_read(self, bytes: u64) -> Self
pub fn app_read(self, bytes: u64) -> Self
The application reads exactly this many bytes over the step, then stops.
The window follows from what is left unread of the standing buffer, or
of the buffer this step sets when combined with Self::set_rcv_buf.
The backlog carries across such a resize untouched, so the window
saturates at zero if the new size is at or below it.
pub fn build(self) -> StaticRwnd
Trait Implementations§
Source§impl Clone for StaticRwndConfig
impl Clone for StaticRwndConfig
Source§fn clone(&self) -> StaticRwndConfig
fn clone(&self) -> StaticRwndConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StaticRwndConfig
impl Debug for StaticRwndConfig
Source§impl Default for StaticRwndConfig
impl Default for StaticRwndConfig
Source§fn default() -> StaticRwndConfig
fn default() -> StaticRwndConfig
Source§impl<'de> Deserialize<'de> for StaticRwndConfigwhere
StaticRwndConfig: Default,
impl<'de> Deserialize<'de> for StaticRwndConfigwhere
StaticRwndConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl RwndTraceConfig for StaticRwndConfig
impl RwndTraceConfig for StaticRwndConfig
fn into_model(self: Box<StaticRwndConfig>) -> Box<dyn RwndTrace>
Auto Trait Implementations§
impl Freeze for StaticRwndConfig
impl RefUnwindSafe for StaticRwndConfig
impl Send for StaticRwndConfig
impl Sync for StaticRwndConfig
impl Unpin for StaticRwndConfig
impl UnsafeUnpin for StaticRwndConfig
impl UnwindSafe for StaticRwndConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>
fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.