Skip to main content

new_best_effort_uuid

Function new_best_effort_uuid 

Source
pub async fn new_best_effort_uuid<F, Fut, E>(
    value_name: &str,
    is_taken: F,
) -> Result<Uuid, E>
where F: FnMut(Uuid) -> Fut, Fut: Future<Output = Result<bool, E>>, E: From<UtilsError>,
Expand description

Generates a business UUID and filters occupied candidates through caller-provided lookup.

This helper does not atomically reserve the value; callers must still rely on a database uniqueness constraint in the later write path. Use with_unique_uuid when check-and-reserve semantics are needed, and perform the write inside the callback.