Struct perseus::state::StateGeneratorInfo
source · pub struct StateGeneratorInfo<B: Serialize + DeserializeOwned + Send + Sync> {
pub path: String,
pub locale: String,
/* private fields */
}
Expand description
The information any function that generates state will be provided.
This must be able to be shared safely between threads.
Fields§
§path: String
The path it is generating for, not including the template name or locale.
Warning: previous versions of Perseus used to prefix this with the template name, and this is no longer done, for convenience of handling.
locale: String
The locale it is generating for.
Implementations§
source§impl<B: Serialize + DeserializeOwned + Send + Sync + 'static> StateGeneratorInfo<B>
impl<B: Serialize + DeserializeOwned + Send + Sync + 'static> StateGeneratorInfo<B>
sourcepub fn get_extra(&self) -> B
pub fn get_extra(&self) -> B
Get the extra build state as an owned type.
Panics
Hypothetically, if there were a failure in the Perseus core such that
your extra build state ended up being malformed, this would panic.
However, this should never happen, as there are multiplr layers of
checks before this that should catch such an event. If this panics,
and if keeps panicking after perseus clean
, please report it as a
bug (assuming all your types are correct).
Trait Implementations§
source§impl<B: Clone + Serialize + DeserializeOwned + Send + Sync> Clone for StateGeneratorInfo<B>
impl<B: Clone + Serialize + DeserializeOwned + Send + Sync> Clone for StateGeneratorInfo<B>
source§fn clone(&self) -> StateGeneratorInfo<B>
fn clone(&self) -> StateGeneratorInfo<B>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more