pub struct PlayerData<T>(/* private fields */);Expand description
A value kept for each player of the world, by uuid
(<world>/yog-data/<mod>/player/<uuid>.ydata, at its key); synced,
to that player alone.
Implementations§
Source§impl<T: Schema + Default + Send + 'static> PlayerData<T>
impl<T: Schema + Default + Send + 'static> PlayerData<T>
pub const fn new(key: &'static str) -> Self
Sourcepub const fn synced(key: &'static str) -> Self
pub const fn synced(key: &'static str) -> Self
Kept, and sent to the clients that see its owner as it changes (their reads the server’s value; their writes their own until it sends the next).
Auto Trait Implementations§
impl<T> !Freeze for PlayerData<T>
impl<T> RefUnwindSafe for PlayerData<T>where
Owned<String, T>: RefUnwindSafe,
impl<T> Send for PlayerData<T>
impl<T> Sync for PlayerData<T>
impl<T> Unpin for PlayerData<T>
impl<T> UnsafeUnpin for PlayerData<T>where
Owned<String, T>: UnsafeUnpin,
impl<T> UnwindSafe for PlayerData<T>where
Owned<String, T>: UnwindSafe,
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