use types::{Authority, DhtId, DestinationAddress};
use super::{Action, RoutingError};
pub trait Interface : Sync + Send {
fn handle_get(&mut self,
type_id: u64,
our_authority: Authority,
from_authority: Authority,
from_address: DhtId,
data: Vec<u8>)
-> Result<Action, RoutingError>;
fn handle_put(&mut self,
our_authority: Authority,
from_authority: Authority,
from_address: DhtId,
dest_address: DestinationAddress,
data: Vec<u8>)
-> Result<Action, RoutingError>;
fn handle_post(&mut self,
our_authority: Authority,
from_authority: Authority,
from_address: DhtId,
data: Vec<u8>)
-> Result<Action, RoutingError>;
fn handle_get_response(&mut self,
from_address: DhtId,
response: Result<Vec<u8>, RoutingError>);
fn handle_put_response(&mut self,
from_authority: Authority,
from_address: DhtId,
response: Result<Vec<u8>, RoutingError>);
fn handle_post_response(&mut self,
from_authority: Authority,
from_address: DhtId,
response: Result<Vec<u8>, RoutingError>);
fn add_node(&mut self, node: DhtId);
fn drop_node(&mut self, node: DhtId);
}