pub struct StatDeserializers { /* private fields */ }
Expand description
Resource containing a name to instance map of Stat
s.
Implementations§
Source§impl StatDeserializers
impl StatDeserializers
Sourcepub fn register_replace<T: Stat>(&mut self)
pub fn register_replace<T: Stat>(&mut self)
Sourcepub fn register_parser<T: Stat>(
&mut self,
f: impl FnMut(&str) -> Option<T> + Send + Sync + 'static,
)
pub fn register_parser<T: Stat>( &mut self, f: impl FnMut(&str) -> Option<T> + Send + Sync + 'static, )
Register a parser to a stat, ones inserted first has priority.
Sourcepub fn register_parser_ok<T: Stat, E>(
&mut self,
f: impl FnMut(&str) -> Result<T, E> + Send + Sync + 'static,
)
pub fn register_parser_ok<T: Stat, E>( &mut self, f: impl FnMut(&str) -> Result<T, E> + Send + Sync + 'static, )
Register a parser to a stat, ones inserted first has priority.
pub fn get(&mut self, name: &str) -> Option<StatInst>
Trait Implementations§
Source§impl Debug for StatDeserializers
impl Debug for StatDeserializers
Source§impl Default for StatDeserializers
impl Default for StatDeserializers
Source§fn default() -> StatDeserializers
fn default() -> StatDeserializers
Returns the “default value” for a type. Read more
impl Resource for StatDeserializers
Auto Trait Implementations§
impl Freeze for StatDeserializers
impl !RefUnwindSafe for StatDeserializers
impl Send for StatDeserializers
impl Sync for StatDeserializers
impl Unpin for StatDeserializers
impl !UnwindSafe for StatDeserializers
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
, which can then be
downcast
into Box<dyn ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
, which can then be further
downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self
using default()
.