naia_shared/world/sync/authority_error.rs
1/// Errors raised by entity- and resource-authority operations.
2///
3/// `Resource*` variants are raised by the Replicated Resources auth API
4/// (e.g. `server.resource_take_authority::<R>()`) and are semantically
5/// distinct from the entity variants — using `NotInScope` for "the
6/// resource isn't currently inserted" would be a misuse.
7#[derive(Debug, Clone, Copy, PartialEq, Eq)]
8pub enum AuthorityError {
9 /// Entity is not configured for delegation.
10 NotDelegated,
11 /// Authority is not currently `Available` (e.g. another holder).
12 NotAvailable,
13 /// Caller does not currently hold authority.
14 NotHolder,
15 /// Entity is not in the user's scope.
16 NotInScope,
17 /// (Resource API) The resource of the requested type `R` is not
18 /// currently inserted on this server/world. Distinct from
19 /// `NotInScope` (which is an entity-scope concept). Returned by
20 /// `server.resource_take_authority::<R>()`,
21 /// `server.resource_release_authority::<R>()`, and the client
22 /// `request_resource_authority` / `release_resource_authority`
23 /// commands when `R` is missing from the registry.
24 ResourceNotPresent,
25}