pub struct OwnedLaw {
pub template_id: LawTemplateId,
pub level: i64,
pub copies: i64,
pub slot_index: Option<i64>,
}Expand description
One law the character owns. There is at most one row per law template: the first copy becomes the working instance, every further copy is stock for the upgrade ladder (raw copies, their own level irrelevant).
Fields§
§template_id: LawTemplateId§level: i641-based; raised by spending copies against the upgrade ladder.
copies: i64Raw copies in stock, not yet spent on the ladder.
slot_index: Option<i64>Slot on the core of this law’s own side, None when unslotted.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for OwnedLaw
impl<'de> Deserialize<'de> for OwnedLaw
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 FromWasmAbi for OwnedLawwhere
Self: DeserializeOwned,
impl FromWasmAbi for OwnedLawwhere
Self: DeserializeOwned,
Source§impl IntoWasmAbi for OwnedLaw
impl IntoWasmAbi for OwnedLaw
Source§impl JsonSchema for OwnedLaw
impl JsonSchema for OwnedLaw
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moreSource§impl OptionFromWasmAbi for OwnedLawwhere
Self: DeserializeOwned,
impl OptionFromWasmAbi for OwnedLawwhere
Self: DeserializeOwned,
Source§impl OptionIntoWasmAbi for OwnedLaw
impl OptionIntoWasmAbi for OwnedLaw
Source§impl RefFromWasmAbi for OwnedLawwhere
Self: DeserializeOwned,
impl RefFromWasmAbi for OwnedLawwhere
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§impl Tsify for OwnedLaw
impl Tsify for OwnedLaw
const DECL: &'static str = "/**\n * One law the character owns. There is at most one row per law template: the\n * first copy becomes the working instance, every further copy is stock for the\n * upgrade ladder (raw copies, their own level irrelevant).\n */\nexport interface OwnedLaw {\n template_id: LawTemplateId;\n /**\n * 1-based; raised by spending `copies` against the upgrade ladder.\n */\n level: number;\n /**\n * Raw copies in stock, not yet spent on the ladder.\n */\n copies: number;\n /**\n * Slot on the core of this law\\\'s own side, `None` when unslotted.\n */\n slot_index: number | null;\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 OwnedLawwhere
Self: DeserializeOwned,
impl VectorFromWasmAbi for OwnedLawwhere
Self: DeserializeOwned,
type Abi = <JsType as VectorFromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[Self]>
Source§impl VectorIntoWasmAbi for OwnedLaw
impl VectorIntoWasmAbi for OwnedLaw
type Abi = <JsType as VectorIntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[Self]>) -> Self::Abi
impl Eq for OwnedLaw
impl StructuralPartialEq for OwnedLaw
Auto Trait Implementations§
impl Freeze for OwnedLaw
impl RefUnwindSafe for OwnedLaw
impl Send for OwnedLaw
impl Sync for OwnedLaw
impl Unpin for OwnedLaw
impl UnwindSafe for OwnedLaw
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,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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.