pub trait CanaryService {
// Required methods
fn embed_canary(
&self,
covers: Vec<CoverMedia>,
embedder: &dyn EmbedTechnique,
) -> Result<(Vec<CoverMedia>, CanaryShard), CanaryError>;
fn check_canary(&self, shard: &CanaryShard) -> bool;
}Expand description
Canary shard tripwire port.
Required Methods§
Sourcefn embed_canary(
&self,
covers: Vec<CoverMedia>,
embedder: &dyn EmbedTechnique,
) -> Result<(Vec<CoverMedia>, CanaryShard), CanaryError>
fn embed_canary( &self, covers: Vec<CoverMedia>, embedder: &dyn EmbedTechnique, ) -> Result<(Vec<CoverMedia>, CanaryShard), CanaryError>
Embed an additional canary shard in covers alongside the regular
distribution.
Returns the modified covers and the CanaryShard to be planted in
a honeypot location.
§Errors
Returns CanaryError::NoCovers or CanaryError::EmbedFailed.
Sourcefn check_canary(&self, shard: &CanaryShard) -> bool
fn check_canary(&self, shard: &CanaryShard) -> bool
Return true if the shard’s notify URL is reachable, indicating
the canary has been accessed.
Non-blocking check; returns false on network error.