pub struct AuthorityModel { /* private fields */ }Expand description
Authority tracking for a set of entities.
Implementations§
Source§impl AuthorityModel
impl AuthorityModel
pub fn new(default_mode: AuthorityMode) -> Self
pub fn set_default_mode(&mut self, mode: AuthorityMode)
pub fn register( &mut self, entity_id: SyncEntityId, mode: AuthorityMode, owner: u32, )
pub fn unregister(&mut self, entity_id: SyncEntityId)
pub fn get_mode(&self, entity_id: SyncEntityId) -> AuthorityMode
pub fn get_owner(&self, entity_id: SyncEntityId) -> Option<u32>
pub fn set_mode(&mut self, entity_id: SyncEntityId, mode: AuthorityMode)
pub fn set_owner(&mut self, entity_id: SyncEntityId, owner: u32)
Sourcepub fn request_transfer(
&mut self,
entity_id: SyncEntityId,
target_client: u32,
timestamp_ms: u64,
) -> bool
pub fn request_transfer( &mut self, entity_id: SyncEntityId, target_client: u32, timestamp_ms: u64, ) -> bool
Request an authority transfer.
Sourcepub fn complete_transfer(&mut self, entity_id: SyncEntityId) -> bool
pub fn complete_transfer(&mut self, entity_id: SyncEntityId) -> bool
Complete a pending transfer.
Sourcepub fn cancel_transfer(&mut self, entity_id: SyncEntityId)
pub fn cancel_transfer(&mut self, entity_id: SyncEntityId)
Cancel a pending transfer.
Check whether a given client has authority over an entity.
Sourcepub fn is_transfer_pending(&self, entity_id: SyncEntityId) -> bool
pub fn is_transfer_pending(&self, entity_id: SyncEntityId) -> bool
Whether a transfer is in progress for the given entity.
pub fn entity_count(&self) -> usize
Auto Trait Implementations§
impl Freeze for AuthorityModel
impl RefUnwindSafe for AuthorityModel
impl Send for AuthorityModel
impl Sync for AuthorityModel
impl Unpin for AuthorityModel
impl UnsafeUnpin for AuthorityModel
impl UnwindSafe for AuthorityModel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.