pub enum PageViewKind {
Html,
ApiOnly,
ApiWithTemplate,
Unrenderable,
}Expand description
What a page type can actually serve, once the declared mode and the template have been reconciled. This is what the renderer branches on.
Variants§
Html
Template only. No JSON representation exists; Accept is ignored.
ApiOnly
JSON only — there is no usable template. Served whatever the client asks for, because it is the sole representation.
ApiWithTemplate
Both representations exist; negotiate on Accept.
Unrenderable
view_mode = "html" was declared but the template is blank.
Nothing is renderable — a misconfiguration, not a mode.
Implementations§
Source§impl PageViewKind
impl PageViewKind
Sourcepub fn serves_json(self) -> bool
pub fn serves_json(self) -> bool
Whether this kind can produce a JSON body at all.
Sourcepub fn serves_html(self) -> bool
pub fn serves_html(self) -> bool
Whether a Tera template will be rendered for this kind.
Trait Implementations§
Source§impl Clone for PageViewKind
impl Clone for PageViewKind
impl Copy for PageViewKind
Source§impl Debug for PageViewKind
impl Debug for PageViewKind
impl Eq for PageViewKind
Source§impl PartialEq for PageViewKind
impl PartialEq for PageViewKind
impl StructuralPartialEq for PageViewKind
Auto Trait Implementations§
impl Forget for PageViewKind
impl Freeze for PageViewKind
impl RefUnwindSafe for PageViewKind
impl Send for PageViewKind
impl Sync for PageViewKind
impl Unpin for PageViewKind
impl UnsafeUnpin for PageViewKind
impl UnwindSafe for PageViewKind
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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> ⓘ
Converts
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> ⓘ
Converts
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 moreCreates a shared type from an unshared type.