Trait holochain_types::db::AsP2pAgentStoreConExt
source · pub trait AsP2pAgentStoreConExt {
// Required methods
fn p2p_get_agent(
&mut self,
agent: &KitsuneAgent
) -> Result<Option<AgentInfoSigned>, DatabaseError>;
fn p2p_remove_agent(
&mut self,
agent: &KitsuneAgent
) -> Result<bool, DatabaseError>;
fn p2p_list_agents(
&mut self
) -> Result<Vec<AgentInfoSigned, Global>, DatabaseError>;
fn p2p_count_agents(&mut self) -> Result<u32, DatabaseError>;
fn p2p_gossip_query_agents(
&mut self,
since_ms: u64,
until_ms: u64,
arcset: DhtArcSet
) -> Result<Vec<AgentInfoSigned, Global>, DatabaseError>;
fn p2p_query_near_basis(
&mut self,
basis: u32,
limit: u32
) -> Result<Vec<AgentInfoSigned, Global>, DatabaseError>;
fn p2p_extrapolated_coverage(
&mut self,
dht_arc_set: DhtArcSet
) -> Result<Vec<f64, Global>, DatabaseError>;
}
Expand description
Extension trait to treat connection instances as p2p store accessors.
Required Methods§
sourcefn p2p_get_agent(
&mut self,
agent: &KitsuneAgent
) -> Result<Option<AgentInfoSigned>, DatabaseError>
fn p2p_get_agent( &mut self, agent: &KitsuneAgent ) -> Result<Option<AgentInfoSigned>, DatabaseError>
Get an AgentInfoSigned record from the p2p_store
sourcefn p2p_remove_agent(
&mut self,
agent: &KitsuneAgent
) -> Result<bool, DatabaseError>
fn p2p_remove_agent( &mut self, agent: &KitsuneAgent ) -> Result<bool, DatabaseError>
Remove an agent from the p2p store
sourcefn p2p_list_agents(
&mut self
) -> Result<Vec<AgentInfoSigned, Global>, DatabaseError>
fn p2p_list_agents( &mut self ) -> Result<Vec<AgentInfoSigned, Global>, DatabaseError>
List all AgentInfoSigned records within a space in the p2p_agent_store
sourcefn p2p_count_agents(&mut self) -> Result<u32, DatabaseError>
fn p2p_count_agents(&mut self) -> Result<u32, DatabaseError>
Count agent records within a space in the p2p_agent_store
sourcefn p2p_gossip_query_agents(
&mut self,
since_ms: u64,
until_ms: u64,
arcset: DhtArcSet
) -> Result<Vec<AgentInfoSigned, Global>, DatabaseError>
fn p2p_gossip_query_agents( &mut self, since_ms: u64, until_ms: u64, arcset: DhtArcSet ) -> Result<Vec<AgentInfoSigned, Global>, DatabaseError>
Query agent list for gossip
sourcefn p2p_query_near_basis(
&mut self,
basis: u32,
limit: u32
) -> Result<Vec<AgentInfoSigned, Global>, DatabaseError>
fn p2p_query_near_basis( &mut self, basis: u32, limit: u32 ) -> Result<Vec<AgentInfoSigned, Global>, DatabaseError>
Query agents sorted by nearness to basis loc
sourcefn p2p_extrapolated_coverage(
&mut self,
dht_arc_set: DhtArcSet
) -> Result<Vec<f64, Global>, DatabaseError>
fn p2p_extrapolated_coverage( &mut self, dht_arc_set: DhtArcSet ) -> Result<Vec<f64, Global>, DatabaseError>
Extrapolate coverage from agents within our own storage arc