Skip to main content

upsert

Function upsert 

Source
pub fn upsert(peers: &mut Vec<SocialPeer>, peer: SocialPeer)
Expand description

Insert or update peer in peers, keyed by SocialPeer::did.

If a peer with the same did already exists it is replaced in place (preserving its position); otherwise peer is appended.