Skip to main content

boxed_source

Function boxed_source 

Source
pub fn boxed_source<S: SnapshotSource + 'static>(
    source: S,
) -> BoxedSnapshotSource
Expand description

Box a SnapshotSource into the BoxedSnapshotSource alias expected by EntropySender::run.

ยงExamples

use dynomite::entropy::{boxed_source, send::StaticSnapshot, SnapshotSource};
let s = boxed_source(StaticSnapshot::new(vec![1, 2, 3]));
assert_eq!(s.snapshot().unwrap(), vec![1, 2, 3]);