pub trait Peer: Clone + Send {
// Required methods
fn subscribe_veilid_update(&self) -> Receiver<VeilidUpdate>;
fn reset(&mut self) -> impl Future<Output = Result<()>> + Send;
fn shutdown(self) -> impl Future<Output = Result<()>> + Send;
fn announce(
&mut self,
index: &Index,
) -> impl Future<Output = Result<(CryptoTyped<CryptoKey>, Target, Header)>> + Send;
fn reannounce_route(
&mut self,
key: &CryptoTyped<CryptoKey>,
prior_route: Option<Target>,
index: &Index,
header: &Header,
) -> impl Future<Output = Result<(Target, Header)>> + Send;
fn resolve(
&mut self,
key: &CryptoTyped<CryptoKey>,
root: &Path,
) -> impl Future<Output = Result<(Target, Header, Index)>> + Send;
fn reresolve_route(
&mut self,
key: &CryptoTyped<CryptoKey>,
prior_route: Option<Target>,
) -> impl Future<Output = Result<(Target, Header)>> + Send;
fn request_block(
&mut self,
target: Target,
piece: usize,
block: usize,
) -> impl Future<Output = Result<Vec<u8>>> + Send;
fn reply_block_contents(
&mut self,
call_id: OperationId,
contents: &[u8],
) -> impl Future<Output = Result<()>> + Send;
}Required Methods§
fn subscribe_veilid_update(&self) -> Receiver<VeilidUpdate>
fn reset(&mut self) -> impl Future<Output = Result<()>> + Send
fn shutdown(self) -> impl Future<Output = Result<()>> + Send
fn announce( &mut self, index: &Index, ) -> impl Future<Output = Result<(CryptoTyped<CryptoKey>, Target, Header)>> + Send
fn reannounce_route( &mut self, key: &CryptoTyped<CryptoKey>, prior_route: Option<Target>, index: &Index, header: &Header, ) -> impl Future<Output = Result<(Target, Header)>> + Send
fn resolve( &mut self, key: &CryptoTyped<CryptoKey>, root: &Path, ) -> impl Future<Output = Result<(Target, Header, Index)>> + Send
fn reresolve_route( &mut self, key: &CryptoTyped<CryptoKey>, prior_route: Option<Target>, ) -> impl Future<Output = Result<(Target, Header)>> + Send
fn request_block( &mut self, target: Target, piece: usize, block: usize, ) -> impl Future<Output = Result<Vec<u8>>> + Send
fn reply_block_contents( &mut self, call_id: OperationId, contents: &[u8], ) -> impl Future<Output = Result<()>> + Send
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.