Skip to main content

offer_hand_offs

Function offer_hand_offs 

Source
pub async fn offer_hand_offs<T, F>(
    channel: &mut PeerChannel,
    sealed: &[SealedHandOff],
    trust: &T,
    versions: &dyn DirectoryVersions,
    on_ack: F,
) -> Result<ServeReport, DelegationError>
Expand description

The origin’s side of a hand-off over a verified peering channel: offer each sealed hand-off to the channel’s peer, serve its ranged pulls, and take its acknowledgements, authorizing every request against trust (serve).

Every hand-off must be sealed for the peer the handshake verified. An acknowledgement must name that peer and one of these hand-offs, and the asset it was sealed for, before on_ack (which records it in the origin ledger) sees it.

§Errors

DelegationError::WrongDelegate for a hand-off sealed for another device (nothing is sent), or the PeeringError that ended the session.