Struct game_features::UnlockableBuilder[][src]

pub struct UnlockableBuilder<U, K, S, I> { /* fields omitted */ }
Expand description

Builder for Unlockable.

Implementations

impl<U: Clone, K: Clone, S: Clone, I: Clone> UnlockableBuilder<U, K, S, I>[src]

pub fn id(&mut self, value: U) -> &mut Self[src]

The key of this unlockable.

pub fn inner(&mut self, value: K) -> &mut Self[src]

The thing we want to unlock access to.

pub fn is_unlocked(&mut self, value: bool) -> &mut Self[src]

Whether we unlocked it or not.

pub fn unlock_stat_conditions(
    &mut self,
    value: Vec<StatCondition<S>>
) -> &mut Self
[src]

The stat conditions required to unlock this element.

pub fn unlock_item_conditions(
    &mut self,
    value: Vec<(I, usize, UseMode)>
) -> &mut Self
[src]

The item conditions required to unlock this element.

pub fn unlock_dependencies(&mut self, value: Vec<U>) -> &mut Self[src]

A list of other unlockables upon which this one depends. If Unlockable B depends on A, then A must be unlocked before B can be unlocked.

pub fn build(&self) -> Result<Unlockable<U, K, S, I>, String>[src]

Builds a new Unlockable.

Errors

If a required field has not been initialized.

Trait Implementations

impl<U: Clone, K: Clone, S: Clone, I: Clone> Clone for UnlockableBuilder<U, K, S, I>[src]

fn clone(&self) -> UnlockableBuilder<U, K, S, I>[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<U: Default, K: Default, S: Default, I: Default> Default for UnlockableBuilder<U, K, S, I>[src]

fn default() -> UnlockableBuilder<U, K, S, I>[src]

Returns the “default value” for a type. Read more

Auto Trait Implementations

impl<U, K, S, I> RefUnwindSafe for UnlockableBuilder<U, K, S, I> where
    I: RefUnwindSafe,
    K: RefUnwindSafe,
    S: RefUnwindSafe,
    U: RefUnwindSafe

impl<U, K, S, I> Send for UnlockableBuilder<U, K, S, I> where
    I: Send,
    K: Send,
    S: Send,
    U: Send

impl<U, K, S, I> Sync for UnlockableBuilder<U, K, S, I> where
    I: Sync,
    K: Sync,
    S: Sync,
    U: Sync

impl<U, K, S, I> Unpin for UnlockableBuilder<U, K, S, I> where
    I: Unpin,
    K: Unpin,
    S: Unpin,
    U: Unpin

impl<U, K, S, I> UnwindSafe for UnlockableBuilder<U, K, S, I> where
    I: UnwindSafe,
    K: UnwindSafe,
    S: UnwindSafe,
    U: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.