Skip to main content

pull_types

Function pull_types 

Source
pub fn pull_types(
    state: &mut SyncState,
    node: &Node<Vec<u8>, Vec<u8>>,
    peer: PeerId,
    addrs: &[Multiaddr],
    types: &[&str],
) -> PullTypesOutcome
Expand description

Pull several record types from peer in one session: one Hello (and at most one roster swap) for all of them, then each type’s pages and acks, every envelope sealed under that type’s own key. Works with any /weirdnet/sync/2 peer (0.7 and 0.8.x answer each request on its own, so the wire does not change).

Each type gets its own PullOutcome, in the order asked: a type the peer refuses (type-not-granted for a service device, type-off where the peer does not sync it) fails alone and the others still pull. A service device does not ask for a type outside its own grant; that type is refused here with type-not-granted. Duplicate types are pulled once.