Struct veloren_common_net::synced_components::inner::inventory::item::ItemI18n
pub struct ItemI18n {
map: HashMap<ItemKey, String>,
}
Expand description
To be used with ItemDesc::i18n
NOTE: there is a limitation to this manifest, as it uses ItemKey and ItemKey isn’t uniquely identifies Item, when it comes to modular items.
If modular weapon has the same primary component and the same hand-ness, we use the same model EVEN IF it has different secondary components, like Staff with Heavy core or Light core.
Translations currently do the same, but maybe they shouldn’t in which case we should either extend ItemKey or use new identifier. We could use ItemDefinitionId, but it’s very generic and cumbersome.
Fields§
§map: HashMap<ItemKey, String>
Implementations§
§impl ItemI18n
impl ItemI18n
pub fn new_expect() -> ItemI18n
Trait Implementations§
§impl Asset for ItemI18n
impl Asset for ItemI18n
§const EXTENSION: &'static str = "ron"
const EXTENSION: &'static str = "ron"
Use this field if your asset only uses one extension. Read more
§const EXTENSIONS: &'static [&'static str] = _
const EXTENSIONS: &'static [&'static str] = _
This field enables you to specify multiple extension for an asset. Read more
§fn default_value(
id: &SharedString,
error: Box<dyn Error + Send + Sync>,
) -> Result<Self, Box<dyn Error + Send + Sync>>
fn default_value( id: &SharedString, error: Box<dyn Error + Send + Sync>, ) -> Result<Self, Box<dyn Error + Send + Sync>>
Specifies a eventual default value to use if an asset fails to load. If
this method returns
Ok
, the returned value is used as an asset. In
particular, if this method always returns Ok
, AssetCache::load
is
guaranteed not to fail. Read more§const HOT_RELOADED: bool = true
const HOT_RELOADED: bool = true
If
false
, disable hot-reloading for assets of this type (true
by
default). This avoids having to lock the asset to read it (ie it makes
[Handle::read
] a noop)§impl<'de> Deserialize<'de> for ItemI18n
impl<'de> Deserialize<'de> for ItemI18n
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ItemI18n, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ItemI18n, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl Serialize for ItemI18n
impl Serialize for ItemI18n
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for ItemI18n
impl RefUnwindSafe for ItemI18n
impl Send for ItemI18n
impl Sync for ItemI18n
impl Unpin for ItemI18n
impl UnwindSafe for ItemI18n
Blanket Implementations§
§impl<T> AssetExt for Twhere
T: Compound,
impl<T> AssetExt for Twhere
T: Compound,
§fn load(specifier: &str) -> Result<&'static Handle<T>, Error>
fn load(specifier: &str) -> Result<&'static Handle<T>, Error>
Function used to load assets from the filesystem or the cache.
Example usage: Read more
fn load_owned(specifier: &str) -> Result<T, Error>
fn get_or_insert(specifier: &str, default: T) -> &'static Handle<T>
§fn load_cloned(specifier: &str) -> Result<Self, Error>where
Self: Clone,
fn load_cloned(specifier: &str) -> Result<Self, Error>where
Self: Clone,
Function used to load assets from the filesystem or the cache and return
a clone.
fn load_or_insert_with( specifier: &str, default: impl FnOnce(Error) -> Self, ) -> &'static Handle<Self>
§fn load_expect(specifier: &str) -> &'static Handle<Self>
fn load_expect(specifier: &str) -> &'static Handle<Self>
Function used to load essential assets from the filesystem or the cache.
It will panic if the asset is not found. Example usage: Read more
§fn load_expect_cloned(specifier: &str) -> Selfwhere
Self: Clone,
fn load_expect_cloned(specifier: &str) -> Selfwhere
Self: Clone,
Function used to load essential assets from the filesystem or the cache
and return a clone. It will panic if the asset is not found.
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> Compound for Twhere
T: Asset,
impl<T> Compound for Twhere
T: Asset,
§fn load(
cache: AnyCache<'_>,
id: &SharedString,
) -> Result<T, Box<dyn Error + Send + Sync>>
fn load( cache: AnyCache<'_>, id: &SharedString, ) -> Result<T, Box<dyn Error + Send + Sync>>
Loads an asset from the cache. Read more
§const HOT_RELOADED: bool = Self::HOT_RELOADED
const HOT_RELOADED: bool = Self::HOT_RELOADED
If
false
, disable hot-reloading for assets of this type (true
by
default). This avoids having to lock the asset to read it (ie it makes
[Handle::read
] a noop)§impl<C, M> ConvertSaveload<M> for C
impl<C, M> ConvertSaveload<M> for C
§type Error = Infallible
type Error = Infallible
Error may occur during serialization or deserialization of component
§fn convert_into<F>(
&self,
_: F,
) -> Result<<C as ConvertSaveload<M>>::Data, <C as ConvertSaveload<M>>::Error>
fn convert_into<F>( &self, _: F, ) -> Result<<C as ConvertSaveload<M>>::Data, <C as ConvertSaveload<M>>::Error>
Convert this data type into serializable form (
Data
) using
entity to marker mapping function§fn convert_from<F>(
data: <C as ConvertSaveload<M>>::Data,
_: F,
) -> Result<C, <C as ConvertSaveload<M>>::Error>
fn convert_from<F>( data: <C as ConvertSaveload<M>>::Data, _: F, ) -> Result<C, <C as ConvertSaveload<M>>::Error>
Convert this data from a deserializable form (
Data
) using
entity to marker mapping function§impl<T> DirLoadable for Twhere
T: Asset,
impl<T> DirLoadable for Twhere
T: Asset,
§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> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more