pub struct WeaponStats {
pub min_damage: f64,
pub max_damage: f64,
pub speed_ms: u32,
pub normalized_speed_s: f64,
pub item_class: i32,
pub subclass: i32,
pub inventory_type: i32,
}Expand description
Per-weapon-slot stats; zeroed means no weapon, so callers must guard against speed_ms == 0.
Fields§
§min_damage: f64§max_damage: f64§speed_ms: u32§normalized_speed_s: f64§item_class: i32§subclass: i32§inventory_type: i32Trait Implementations§
Source§impl Clone for WeaponStats
impl Clone for WeaponStats
Source§fn clone(&self) -> WeaponStats
fn clone(&self) -> WeaponStats
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WeaponStats
impl Debug for WeaponStats
Source§impl Default for WeaponStats
impl Default for WeaponStats
Source§fn default() -> WeaponStats
fn default() -> WeaponStats
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for WeaponStats
impl<'de> Deserialize<'de> for WeaponStats
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<WeaponStats> for JsValuewhere
WeaponStats: Serialize,
impl From<WeaponStats> for JsValuewhere
WeaponStats: Serialize,
Source§fn from(value: WeaponStats) -> Self
fn from(value: WeaponStats) -> Self
Converts to this type from the input type.
Source§impl FromWasmAbi for WeaponStatswhere
Self: DeserializeOwned,
impl FromWasmAbi for WeaponStatswhere
Self: DeserializeOwned,
Source§impl IntoWasmAbi for &WeaponStatswhere
WeaponStats: Serialize,
impl IntoWasmAbi for &WeaponStatswhere
WeaponStats: Serialize,
Source§impl IntoWasmAbi for WeaponStatswhere
WeaponStats: Serialize,
impl IntoWasmAbi for WeaponStatswhere
WeaponStats: Serialize,
Source§impl OptionFromWasmAbi for WeaponStatswhere
Self: DeserializeOwned,
impl OptionFromWasmAbi for WeaponStatswhere
Self: DeserializeOwned,
Source§impl OptionIntoWasmAbi for WeaponStatswhere
WeaponStats: Serialize,
impl OptionIntoWasmAbi for WeaponStatswhere
WeaponStats: Serialize,
Source§impl RefFromWasmAbi for WeaponStatswhere
Self: DeserializeOwned,
impl RefFromWasmAbi for WeaponStatswhere
Self: DeserializeOwned,
Source§type Abi = <JsType as RefFromWasmAbi>::Abi
type Abi = <JsType as RefFromWasmAbi>::Abi
The Wasm ABI type references to
Self are recovered from.Source§type Anchor = SelfOwner<WeaponStats>
type Anchor = SelfOwner<WeaponStats>
The type that holds the reference to
Self for the duration of the
invocation of the function that has an &Self parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.Source§impl Serialize for WeaponStats
impl Serialize for WeaponStats
Source§impl Tsify for WeaponStats
impl Tsify for WeaponStats
const DECL: &'static str = "/**\n * Per-weapon-slot stats; zeroed means no weapon, so callers must guard against `speed_ms == 0`.\n */\nexport interface WeaponStats {\n min_damage: number;\n max_damage: number;\n speed_ms: number;\n normalized_speed_s: number;\n item_class: number;\n subclass: number;\n inventory_type: number;\n}"
const SERIALIZATION_CONFIG: SerializationConfig
type JsType = JsType
fn into_js(&self) -> Result<Self::JsType, Error>where
Self: Serialize,
fn from_js<T>(js: T) -> Result<Self, Error>
Source§impl VectorFromWasmAbi for WeaponStatswhere
Self: DeserializeOwned,
impl VectorFromWasmAbi for WeaponStatswhere
Self: DeserializeOwned,
type Abi = <JsType as VectorFromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[Self]>
Source§impl VectorIntoWasmAbi for WeaponStatswhere
WeaponStats: Serialize,
impl VectorIntoWasmAbi for WeaponStatswhere
WeaponStats: Serialize,
type Abi = <JsType as VectorIntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[Self]>) -> Self::Abi
Source§impl WasmDescribe for WeaponStats
impl WasmDescribe for WeaponStats
Source§impl WasmDescribeVector for WeaponStats
impl WasmDescribeVector for WeaponStats
impl Copy for WeaponStats
Auto Trait Implementations§
impl Freeze for WeaponStats
impl RefUnwindSafe for WeaponStats
impl Send for WeaponStats
impl Sync for WeaponStats
impl Unpin for WeaponStats
impl UnsafeUnpin for WeaponStats
impl UnwindSafe for WeaponStats
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.