use generic_sendable_type;
use name_type::NameType;
use types::{Authority, DestinationAddress};
use super::{Action, RoutingError};
pub trait Interface : Sync + Send {
fn handle_get(&mut self,
type_id: u64,
name: NameType,
our_authority: Authority,
from_authority: Authority,
from_address: NameType) -> Result<Action, RoutingError>;
fn handle_put(&mut self,
our_authority: Authority,
from_authority: Authority,
from_address: NameType,
dest_address: DestinationAddress,
data: Vec<u8>) -> Result<Action, RoutingError>;
fn handle_post(&mut self,
our_authority: Authority,
from_authority: Authority,
from_address: NameType,
data: Vec<u8>) -> Result<Action, RoutingError>;
fn handle_get_response(&mut self,
from_address: NameType,
response: Result<Vec<u8>, RoutingError>);
fn handle_put_response(&mut self,
from_authority: Authority,
from_address: NameType,
response: Result<Vec<u8>, RoutingError>);
fn handle_post_response(&mut self,
from_authority: Authority,
from_address: NameType,
response: Result<Vec<u8>, RoutingError>);
fn handle_churn(&mut self, close_group: Vec<NameType>) -> Vec<(NameType, generic_sendable_type::GenericSendableType)>;
fn handle_cache_get(&mut self,
type_id: u64,
name: NameType,
from_authority: Authority,
from_address: NameType) -> Result<Action, RoutingError>;
fn handle_cache_put(&mut self,
from_authority: Authority,
from_address: NameType,
data: Vec<u8>) -> Result<Action, RoutingError>;
}