[−][src]Struct akashi::Card
Represents a tradable card.
Strictly speaking, this is just a bare-bones Entity
.
Methods
impl Card
[src]
pub fn new(
id: Snowflake,
component_manager: Arc<ComponentManager<Card>>,
components_attached: HashSet<TypeId>
) -> Card
[src]
id: Snowflake,
component_manager: Arc<ComponentManager<Card>>,
components_attached: HashSet<TypeId>
) -> Card
Create a new Card
instance.
pub fn generate(
snowflake_gen: &mut SnowflakeGenerator,
component_manager: Arc<ComponentManager<Card>>
) -> Card
[src]
snowflake_gen: &mut SnowflakeGenerator,
component_manager: Arc<ComponentManager<Card>>
) -> Card
Create an 'empty' Card
instance with a random ID.
pub fn id(&self) -> Snowflake
[src]
Get this Card
's unique ID.
pub fn component_manager(&self) -> &ComponentManager<Card>
[src]
Get a reference to this Card
's associated ComponentManager
.
Trait Implementations
impl Clone for Card
[src]
impl Component<Card> for AttachedCardType
[src]
impl Debug for Card
[src]
impl Entity for Card
[src]
fn new(
id: Snowflake,
cm: Arc<ComponentManager<Card>>,
components: HashSet<TypeId>
) -> Card
[src]
id: Snowflake,
cm: Arc<ComponentManager<Card>>,
components: HashSet<TypeId>
) -> Card
fn id(&self) -> Snowflake
[src]
fn component_manager(&self) -> &ComponentManager<Card>
[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<Card> for Card
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Card
impl Send for Card
impl Sync for Card
impl Unpin for Card
impl !UnwindSafe for Card
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>,