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>

source

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>

source§

fn clone(&self) -> StateGeneratorInfo<B>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<B: Debug + Serialize + DeserializeOwned + Send + Sync> Debug for StateGeneratorInfo<B>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<B> RefUnwindSafe for StateGeneratorInfo<B>where B: RefUnwindSafe,

§

impl<B> Send for StateGeneratorInfo<B>

§

impl<B> Sync for StateGeneratorInfo<B>

§

impl<B> Unpin for StateGeneratorInfo<B>where B: Unpin,

§

impl<B> UnwindSafe for StateGeneratorInfo<B>where B: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.