pub trait ContentSource {
// Required method
fn locate(&self, hash: &ContentHash) -> Option<PathBuf>;
}Expand description
Where a replica gets content it does not have: a peer, in practice.
Content is handed over by path so that it is never held in memory whole.
Required Methods§
Sourcefn locate(&self, hash: &ContentHash) -> Option<PathBuf>
fn locate(&self, hash: &ContentHash) -> Option<PathBuf>
A file holding exactly the content hash, if there is one. The replica copies
it through a verifying staging writer, so a wrong file is refused, not trusted.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".