pub struct Shadower { /* private fields */ }Expand description
The shadower. Cheap to clone — both backends are Arc-shaped.
Implementations§
Source§impl Shadower
impl Shadower
Sourcepub fn new(
primary: Arc<dyn Backend>,
shadow: Arc<dyn Backend>,
config: ShadowConfig,
) -> Self
pub fn new( primary: Arc<dyn Backend>, shadow: Arc<dyn Backend>, config: ShadowConfig, ) -> Self
Build a shadower with the default ring-buffer-backed DivergenceLog.
Sourcepub fn with_log(self, log: Arc<DivergenceLog>) -> Self
pub fn with_log(self, log: Arc<DivergenceLog>) -> Self
Override the log (e.g. with a custom capacity).
Sourcepub fn divergences(&self) -> Vec<DivergenceEntry>
pub fn divergences(&self) -> Vec<DivergenceEntry>
Snapshot the divergence log.
Sourcepub async fn call(&self, input: &[u8]) -> Result<ShadowOutcome, ShadowError>
pub async fn call(&self, input: &[u8]) -> Result<ShadowOutcome, ShadowError>
Issue a call. Both legs run concurrently. The shadow’s deadline is the
ShadowConfig::shadow_timeout; expiry never blocks the primary.
Sourcepub fn divergence_count(&self) -> usize
pub fn divergence_count(&self) -> usize
Internal — count entries (used by tests).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Shadower
impl !RefUnwindSafe for Shadower
impl Send for Shadower
impl Sync for Shadower
impl Unpin for Shadower
impl UnsafeUnpin for Shadower
impl !UnwindSafe for Shadower
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