pub enum Publicity {
Private,
Public,
Delegated,
}Expand description
Publication visibility of an entity — the shared axis used on both sides of the connection.
On the server, Publicity is embedded in ReplicationConfig and
controls how an entity replicates to clients.
On the client, Publicity is passed directly to
EntityMut::configure_replication.
The three variants represent the full lifecycle of a client-authoritative entity:
Server spawns → Delegated
↓ client requests authority
Client holds → Private (not yet published)
↓ client publishes
All peers see → Public
↓ client releases or server revokes
Server resumes → Delegated / PublicVariants§
Private
The entity is owned by a client but not yet visible to other peers.
Used while a client is constructing or preparing an entity before
choosing to publish it. Server-spawned entities are never Private.
Public
The entity replicates to all peers that share a room and scope with it.
The default state for server-spawned entities. A client sets an entity
Public to make its own client-spawned entity visible to other clients.
Delegated
The server can delegate authority over this entity to a client.
When a server entity is configured Delegated, clients may call
Client::entity_request_authority to request ownership. The server
grants or denies the request via EntityAuthGrantedEvent or
EntityAuthDeniedEvent. While a client holds authority its
mutations replicate back to the server; the server can revoke at
any time.
Implementations§
Source§impl Publicity
impl Publicity
Sourcepub fn is_delegated(&self) -> bool
pub fn is_delegated(&self) -> bool
Returns true if this is Publicity::Delegated.