pub struct WithProgress<S, C> {
pub schedule: S,
pub callback: C,
}
Expand description
Runs the inner schedule
after calling the given callback
let schedule = WithProgress {
schedule: MinChainLen(100_000),
callback: |chain: &[_]| eprintln!("{} %", 100 * chain.len() / 100_000),
};
let (chain, accepted) = sample(&model, walkers, schedule, Serial);
Fields§
§schedule: S
The inner schedule which determines the number of iterations
callback: C
The callback which is executed after each iteration
Trait Implementations§
Source§impl<P, S, C> Schedule<P> for WithProgress<S, C>
impl<P, S, C> Schedule<P> for WithProgress<S, C>
Auto Trait Implementations§
impl<S, C> Freeze for WithProgress<S, C>
impl<S, C> RefUnwindSafe for WithProgress<S, C>where
S: RefUnwindSafe,
C: RefUnwindSafe,
impl<S, C> Send for WithProgress<S, C>
impl<S, C> Sync for WithProgress<S, C>
impl<S, C> Unpin for WithProgress<S, C>
impl<S, C> UnwindSafe for WithProgress<S, C>where
S: UnwindSafe,
C: UnwindSafe,
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
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>
Converts
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>
Converts
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 more