pub fn join_space(
library: &mut Library,
network: &Network,
code: &PairingCode,
timeout: Duration,
now: &dyn Fn() -> u64,
rng: &mut impl CryptoRng,
) -> Result<JoinedSpace, NodeError>Expand description
Joins a shared space by the invitation of the replica that shows code on the network,
and syncs the space with it: it tries each that announces the code’s first two digits in
turn, waiting up to timeout to find the first. network is this replica’s. If the
first sync fails, the space is removed again, and a new invitation makes this replica the
same member. The user’s other replicas get the space through the personal space, after
their next syncs with this one.
§Errors
Returns NodeError::NoSponsor if no replica announces the code in time,
NodeError::Sync with SyncError::WrongCode if the code matched with none,
NodeError::HoldsSpace if this library holds the space already, NodeError::Sync
with SyncError::Ended and Reason::Declined if the person who invites declined,
NodeError::InvitationFailed if the first sync failed, and other errors if the
network or the files fail.