pub trait ValidMutBorrowIdempotenceFor<F: FnMut(&In) -> Out, In: ?Sized, Out, R: Retries, const WAS_MUT: bool>: Sealed<F, In, Out, R, WAS_MUT> { }Expand description
Marker trait for idempotence of closures that borrow their input (FnMut(&In) -> Out).
A proof is required when the stream has retries (AtLeastOnce) and the closure
mutably captures state (WAS_MUT). Definition (borrowing closures,
|item: &T| -> Out, e.g. filter / partition / inspect): processing an item
twice in a row must (1) leave the mutably-captured state (e.g. Singleton::by_mut
references) in the same final value as processing it once, and (2) keep the
operator’s observable output unchanged. For filter and partition, the predicate
must return the same decision both times as when processing the item once (for
partition, an element rejected on retry would appear in the other output). For
inspect, the elements pass through unchanged, so only condition (1) applies.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".