distrans_peer

Trait Peer

Source
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§

Source

fn subscribe_veilid_update(&self) -> Receiver<VeilidUpdate>

Source

fn reset(&mut self) -> impl Future<Output = Result<()>> + Send

Source

fn shutdown(self) -> impl Future<Output = Result<()>> + Send

Source

fn announce( &mut self, index: &Index, ) -> impl Future<Output = Result<(CryptoTyped<CryptoKey>, Target, Header)>> + Send

Source

fn reannounce_route( &mut self, key: &CryptoTyped<CryptoKey>, prior_route: Option<Target>, index: &Index, header: &Header, ) -> impl Future<Output = Result<(Target, Header)>> + Send

Source

fn resolve( &mut self, key: &CryptoTyped<CryptoKey>, root: &Path, ) -> impl Future<Output = Result<(Target, Header, Index)>> + Send

Source

fn reresolve_route( &mut self, key: &CryptoTyped<CryptoKey>, prior_route: Option<Target>, ) -> impl Future<Output = Result<(Target, Header)>> + Send

Source

fn request_block( &mut self, target: Target, piece: usize, block: usize, ) -> impl Future<Output = Result<Vec<u8>>> + Send

Source

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.

Implementors§

Source§

impl Peer for Veilid

Source§

impl<P: Peer + 'static> Peer for Observable<P>