pub trait DecoyProvider: Send + Sync {
// Required methods
fn name(&self) -> &'static str;
fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn feed_input<'life0, 'async_trait>(
&'life0 self,
packet: DynamicByteBuffer,
tailer_buf: DynamicByteBuffer,
) -> Pin<Box<dyn Future<Output = Option<DynamicByteBuffer>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn feed_output<'life0, 'async_trait>(
&'life0 self,
body: DynamicByteBuffer,
tailer_buf: DynamicByteBuffer,
) -> Pin<Box<dyn Future<Output = Option<DynamicByteBuffer>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Object-safe runtime interface for decoy traffic. Used as Arc<dyn DecoyProvider> in
flow managers — no external lock wraps it, so implementations must manage their own
mutable state via interior mutability (e.g. Arc<RwLock<_>>, as every built-in provider
does). All async methods are boxed automatically by async_trait.
Required Methods§
Sourcefn name(&self) -> &'static str
fn name(&self) -> &'static str
Short display name of this provider (e.g. “SparseDecoyProvider”).
Sourcefn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Start the background decoy generation timer.
Sourcefn feed_input<'life0, 'async_trait>(
&'life0 self,
packet: DynamicByteBuffer,
tailer_buf: DynamicByteBuffer,
) -> Pin<Box<dyn Future<Output = Option<DynamicByteBuffer>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn feed_input<'life0, 'async_trait>(
&'life0 self,
packet: DynamicByteBuffer,
tailer_buf: DynamicByteBuffer,
) -> Pin<Box<dyn Future<Output = Option<DynamicByteBuffer>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Process an incoming packet, updating internal rate tracking.
tailer_buf is the deobfuscated tailer for the packet (flags, packet number, etc.).
Sourcefn feed_output<'life0, 'async_trait>(
&'life0 self,
body: DynamicByteBuffer,
tailer_buf: DynamicByteBuffer,
) -> Pin<Box<dyn Future<Output = Option<DynamicByteBuffer>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn feed_output<'life0, 'async_trait>(
&'life0 self,
body: DynamicByteBuffer,
tailer_buf: DynamicByteBuffer,
) -> Pin<Box<dyn Future<Output = Option<DynamicByteBuffer>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Process an outgoing packet body and its plaintext tailer, updating internal rate tracking.
Returns the (possibly modified) body, or None to suppress the packet entirely.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".