Skip to main content

Request

Struct Request 

Source
pub struct Request {
    pub format: String,
    pub project_name: String,
    pub language: String,
    pub top_level_as_chapters: bool,
    pub chapters: Vec<Chapter>,
    pub settings: Map<String, Value>,
    pub locale: Option<String>,
    pub images: Vec<Image>,
    pub cover_image_id: Option<i32>,
}

Fields§

§format: String

Which of the manifest’s [[exporters]] formats to render.

§project_name: String§language: String

The project’s BCP 47 tag.

§top_level_as_chapters: bool

Whether the scene tree’s top-level nodes are chapters; when not, the story is one chapter.

§chapters: Vec<Chapter>§settings: Map<String, Value>

The plugin’s declared settings, every key present.

§locale: Option<String>

The UI’s BCP 47 tag, for replying in the user’s language; not Request::language, the story’s.

§images: Vec<Image>

For a format whose manifest entry sets images = true, each project image the story refers to whose file Hammer could read, sorted by id, and the cover with cover = true; empty otherwise.

§cover_image_id: Option<i32>

The cover’s id among Request::images, with cover = true; none when the project has no cover or its file could not be read.

Implementations§

Source§

impl Request

Source

pub fn image(&self, id: i32) -> Option<&Image>

The image id among Request::images, or none when it is not there.

Source

pub fn cover(&self) -> Option<&Image>

The cover among Request::images, or none when there is none.

Trait Implementations§

Source§

impl<'de> Deserialize<'de> for Request

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.