[−][src]Struct kad::search::Search
Search object provides the basis for executing searches on the DHT
Methods
impl<Id, Addr, Data, Table, Conn, ReqId, Ctx> Search<Id, Addr, Data, Table, Conn, ReqId, Ctx> where
Id: DatabaseId + 'static,
Addr: Clone + Debug + 'static,
Data: Clone + Debug + 'static,
Table: NodeTable<Id, Addr> + 'static,
ReqId: RequestId + 'static,
Ctx: Clone + PartialEq + Debug + 'static,
Conn: Connector<ReqId, Node<Id, Addr>, Request<Id, Data>, Response<Id, Addr, Data>, DhtError, Ctx> + Clone + 'static,
[src]
Id: DatabaseId + 'static,
Addr: Clone + Debug + 'static,
Data: Clone + Debug + 'static,
Table: NodeTable<Id, Addr> + 'static,
ReqId: RequestId + 'static,
Ctx: Clone + PartialEq + Debug + 'static,
Conn: Connector<ReqId, Node<Id, Addr>, Request<Id, Data>, Response<Id, Addr, Data>, DhtError, Ctx> + Clone + 'static,
pub fn new(
origin: Id,
target: Id,
op: Operation,
config: Config,
table: Arc<Mutex<Table>>,
conn: Conn,
ctx: Ctx
) -> Search<Id, Addr, Data, Table, Conn, ReqId, Ctx>
[src]
origin: Id,
target: Id,
op: Operation,
config: Config,
table: Arc<Mutex<Table>>,
conn: Conn,
ctx: Ctx
) -> Search<Id, Addr, Data, Table, Conn, ReqId, Ctx>
pub fn target(&self) -> &Id
[src]
Fetch a pointer to the search target Id
pub fn known(&self) -> KnownMap<Id, Addr>
[src]
Fetch a copy of the Known Nodes map
pub fn data(&self) -> ValueMap<Id, Data>
[src]
Fetch a copy of the Received Data map
pub fn execute(
self
) -> impl Future<Item = Self, Error = DhtError>
[src]
self
) -> impl Future<Item = Self, Error = DhtError>
pub fn seed(&mut self, known: &[Node<Id, Addr>])
[src]
Seed the search with nearest nodes in addition to those provided in initialisation
Auto Trait Implementations
impl<Id, Addr, Data, Table, Conn, ReqId, Ctx> Send for Search<Id, Addr, Data, Table, Conn, ReqId, Ctx> where
Addr: Send,
Conn: Send,
Ctx: Send,
Data: Send,
Id: Send,
ReqId: Send,
Table: Send,
Addr: Send,
Conn: Send,
Ctx: Send,
Data: Send,
Id: Send,
ReqId: Send,
Table: Send,
impl<Id, Addr, Data, Table, Conn, ReqId, Ctx> Sync for Search<Id, Addr, Data, Table, Conn, ReqId, Ctx> where
Addr: Sync,
Conn: Sync,
Ctx: Sync,
Data: Sync,
Id: Sync,
ReqId: Sync,
Table: Send,
Addr: Sync,
Conn: Sync,
Ctx: Sync,
Data: Sync,
Id: Sync,
ReqId: Sync,
Table: Send,
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,