Skip to main content

follow_name

Function follow_name 

Source
pub fn follow_name<E: From<KeyError>>(
    person: &PersonEntries,
    name: &SavedName,
    current: impl FnOnce() -> Result<Option<RestoreCode>, E>,
) -> Result<(), E>
Expand description

Rewrite the entry’s name when name is newer, keeping the code the entry holds: only setup, joining, restoring, resetting and member-key replacement save a code over a readable one (§13.1). An absent entry stays absent, so a forgotten entry stays forgotten.

This device has the store open, so it holds the store’s current code and name. An entry it can’t read (another format, another store’s code, or a copy in more than one keychain group) is replaced with current’s code under name, as one copy. When current gives no code, because this device’s keys were replaced, the store has no location, or the member was removed, the entry stays as it is. A keychain failure fails the call.