[−][src]Struct akashi::Player
Represents a player / user.
Strictly speaking, this is just a minimal Entity
object.
Methods
impl Player
[src]
pub fn new(
id: Snowflake,
component_manager: Arc<ComponentManager<Player>>,
components_attached: HashSet<TypeId>
) -> Player
[src]
id: Snowflake,
component_manager: Arc<ComponentManager<Player>>,
components_attached: HashSet<TypeId>
) -> Player
Create a new Player
instance.
pub fn empty(
snowflake_gen: &mut SnowflakeGenerator,
component_manager: Arc<ComponentManager<Player>>
) -> Player
[src]
snowflake_gen: &mut SnowflakeGenerator,
component_manager: Arc<ComponentManager<Player>>
) -> Player
Create an 'empty' Player
instance with no attached Components
and a randomly-generated ID.
pub fn id(&self) -> Snowflake
[src]
Get this Player
's unique ID.
pub fn component_manager(&self) -> &ComponentManager<Player>
[src]
Get a reference to this Player
's associated ComponentManager
.
Trait Implementations
impl Clone for Player
[src]
impl Component<Player> for Inventory
[src]
impl Component<Player> for Vec<Snowflake>
[src]
impl Component<Player> for Resource
[src]
impl Debug for Player
[src]
impl Entity for Player
[src]
fn new(
id: Snowflake,
cm: Arc<ComponentManager<Self>>,
components: HashSet<TypeId>
) -> Self
[src]
id: Snowflake,
cm: Arc<ComponentManager<Self>>,
components: HashSet<TypeId>
) -> Self
fn id(&self) -> Snowflake
[src]
fn component_manager(&self) -> &ComponentManager<Player>
[src]
fn components_attached(&self) -> &HashSet<TypeId>
[src]
fn components_attached_mut(&mut self) -> &mut HashSet<TypeId>
[src]
fn dirty(&self) -> bool
[src]
fn dirty_mut(&mut self) -> &mut bool
[src]
fn get_component<T: Component<Self> + 'static>(
&self
) -> Result<Option<T>, Error>
[src]
&self
) -> Result<Option<T>, Error>
fn set_component<T: Component<Self> + 'static>(
&mut self,
component: T
) -> Result<(), Error>
[src]
&mut self,
component: T
) -> Result<(), Error>
fn has_component<T: Component<Self> + 'static>(&self) -> bool
[src]
fn delete_component<T: Component<Self> + 'static>(
&mut self
) -> Result<(), Error>
[src]
&mut self
) -> Result<(), Error>
fn clear_components(&mut self) -> Result<(), ClearComponentsError>
[src]
impl PartialEq<Player> for Player
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Player
impl Send for Player
impl Sync for Player
impl Unpin for Player
impl !UnwindSafe for Player
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Downcast for T where
T: Any,
[src]
T: Any,
fn into_any(self: Box<T>) -> Box<dyn Any + 'static>
[src]
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
[src]
fn as_any(&self) -> &(dyn Any + 'static)
[src]
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
[src]
impl<T> DowncastSync for T where
T: Send + Sync + Any,
[src]
T: Send + Sync + Any,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,