Function wicrs_server::api::change_nickname [−][src]
pub async fn change_nickname<S: Into<String> + Clone>(
user: &User,
hub_id: &ID,
new_name: S
) -> Result<String>
Changes a user’s nickname in a hub.
Arguments
user
- User whose nickname is to be changed.hub_id
- ID of the hub where the new nickname should be applied.new_name
- New nickname to be used.
Errors
This function may return an error for any of the following reasons:
- THe user is not in the hub.
- The new name failed to pass the checks for any of the reasons outlined in
check_name_validity
. - The hub could not be loaded for any of the reasons outlined by
Hub::load
. - The hub could not be saved for any of the reasons outlined by
Hub::save
.