pub struct Answers<'a> { /* private fields */ }Expand description
What decides an answer: the served folder with its entry document, its widget modules, its design store, the problems each page lists and whether comments are on. Every address it answers with is under the served folder’s mount, which the documents carry.
Implementations§
Source§impl<'a> Answers<'a>
impl<'a> Answers<'a>
Sourcepub fn new(
folder: &'a Folder,
modules: &'a Modules,
designs: &'a Designs,
preview: Option<&'a Preview>,
comments: bool,
) -> Self
pub fn new( folder: &'a Folder, modules: &'a Modules, designs: &'a Designs, preview: Option<&'a Preview>, comments: bool, ) -> Self
Answers from folder, its widget modules, its design store
designs and the preview that finds each page’s problems — or
none, and no page lists any — with comments shown or not.
Sourcepub fn home(&self) -> Answer
pub fn home(&self) -> Answer
/ leads to the entry document as its file says now — or, while the
file is invalid, shows why.
Sourcepub fn path(&self, path: &str, query: Option<&str>) -> Answer
pub fn path(&self, path: &str, query: Option<&str>) -> Answer
path — relative to the served folder, already decoded — asked with
query. A document file opens as its kind; a Markdown file becomes a
page of its nearest site, or a doc of one chapter; <design>.png and
<deck>/<n>.png name PNGs, unless a real file of that name is there;
anything else in the served folder is sent as it is.
Sourcepub fn missing(&self, path: &str) -> Answer
pub fn missing(&self, path: &str) -> Answer
path, with nothing at it — or nothing that is shown: why, and the
page a browser is shown. Inside a site, in that site’s frame: the
404.md beside its document file, or devpage’s own page; outside any
site, devpage’s own page alone. devpage’s own offers the file the
address most likely meant, when there is one.
Sourcepub fn extension_page(
&self,
path: &str,
document: &Path,
page: &str,
markdown: String,
) -> Answer
pub fn extension_page( &self, path: &str, document: &Path, page: &str, markdown: String, ) -> Answer
A page of an extension, at path: markdown, what the extension’s
program answered for it, drawn in the frame of the document whose
file is document — a page of a site, or of any other document a doc
of this one chapter. page is the page as its extension names it,
which the content’s parts are named by.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Answers<'a>
impl<'a> !UnwindSafe for Answers<'a>
impl<'a> Forget for Answers<'a>
impl<'a> Freeze for Answers<'a>
impl<'a> Move for Answers<'a>
impl<'a> Send for Answers<'a>
impl<'a> Sync for Answers<'a>
impl<'a> Unpin for Answers<'a>
impl<'a> UnsafeUnpin for Answers<'a>where
&'a Folder: UnsafeUnpin,
&'a Modules: UnsafeUnpin,
&'a Designs: UnsafeUnpin,
&'a Preview: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
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>
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)
&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)
&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> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> Fruit for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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> ⓘ
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> ⓘ
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