Skip to main content

AdaptiveInstance

Trait AdaptiveInstance 

Source
pub trait AdaptiveInstance:
    Send
    + Sync
    + 'static {
    // Required methods
    fn header(&self) -> &HandshakeHeader;
    fn ring(&self) -> &ObservationRing;
    fn make_policy(&self) -> Box<dyn Policy>;

    // Provided method
    fn apply_migration(&self, new_tag: u32) { ... }
}
Expand description

Trait implemented by adaptive primitive instances that opt into sidecar observation. The Box guarantees stable addresses for the header and ring.

Required Methods§

Provided Methods§

Source

fn apply_migration(&self, new_tag: u32)

Called by the sidecar when the policy returns a new strategy tag. Default implementation: just set the tag on the header. Primitives that need heavier migration (data-layout swap) override this to perform the swap before (or after) updating the tag.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§