use agent_uri::{AgentUri, CapabilityPath, TrustRoot};
use crate::{DhtError, Endpoint, Registration};
pub trait Dht: Send + Sync {
fn register(&self, registration: Registration) -> Result<(), DhtError>;
fn update_endpoint(
&self,
agent_uri: &AgentUri,
new_endpoints: Vec<Endpoint>,
) -> Result<(), DhtError>;
fn deregister(&self, agent_uri: &AgentUri) -> Result<(), DhtError>;
fn lookup_exact(
&self,
trust_root: &TrustRoot,
capability_path: &CapabilityPath,
) -> Result<Vec<Registration>, DhtError>;
fn lookup_prefix(
&self,
trust_root: &TrustRoot,
capability_path: &CapabilityPath,
) -> Result<Vec<Registration>, DhtError>;
fn lookup_global(&self, capability_path: &CapabilityPath)
-> Result<Vec<Registration>, DhtError>;
}