pub enum PageStatus {
Draft,
Scheduled,
Published,
Archived,
Expired,
}Expand description
Lifecycle state of a page. Stored as a short string column so it survives migrations cleanly and is grep-able in the DB.
Variants§
Draft
Scheduled
Published
Archived
Superseded but preserved: served publicly at 200, stays searchable and in the sitemap (capped priority), frozen against unpublish/ delete. Archiving prevents content from becoming unavailable — it is a preservation lock, not a step toward deletion.
Expired
Terminal takedown state reached when expire_at passes.
Unlike Self::Archived it is NOT served — it 404s
exactly as an expired page did before archived became serve-able.
Sweep-set only; not selectable in the editor.
Implementations§
Source§impl PageStatus
impl PageStatus
Sourcepub const EDITABLE: [Self; 4]
pub const EDITABLE: [Self; 4]
The statuses an editor (the page form, an MCP agent) may set;
expired is reached only by the schedule sweep.
Sourcepub fn parse_editable(s: &str) -> Option<Self>
pub fn parse_editable(s: &str) -> Option<Self>
A status an editor may set, or None — the one parser for every
write path (#763), so they can’t accept different sets again.
Sourcepub fn public_strings() -> [String; 2]
pub fn public_strings() -> [String; 2]
Self::PUBLIC as owned strings, for an is_in filter on
Page::status.
Sourcepub fn parse(s: &str) -> Option<Self>
pub fn parse(s: &str) -> Option<Self>
The status a stored or submitted string names; None for any
other string.
pub fn as_str(self) -> &'static str
Sourcepub fn is_public(self) -> bool
pub fn is_public(self) -> bool
Statuses served to anonymous visitors (200). archived joins
published; expired stays excluded so takedown still
404s.
Sourcepub fn str_is_public(status: &str) -> bool
pub fn str_is_public(status: &str) -> bool
is_public for a status read off a row.
Page::status is a String, so every caller was comparing
against two as_str() literals by hand — and the one that
compared against Published alone (api::pages::find) silently
disagreed with the rest of the API about archived pages. One
place to be wrong is better than four.
Sourcepub fn str_goes_live(from: &str, to: &str) -> bool
pub fn str_goes_live(from: &str, to: &str) -> bool
Whether a save moving a page from from to to puts it live —
now, or on a schedule the sweep will publish. That takes the
publish right whichever status gets there: archived is served like
published, so gating on the published literal alone let an
edit-only user make a draft public.
Trait Implementations§
Source§impl Clone for PageStatus
impl Clone for PageStatus
impl Copy for PageStatus
Source§impl Debug for PageStatus
impl Debug for PageStatus
Source§impl<'de> Deserialize<'de> for PageStatus
impl<'de> Deserialize<'de> for PageStatus
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for PageStatus
Source§impl PartialEq for PageStatus
impl PartialEq for PageStatus
Source§impl Serialize for PageStatus
impl Serialize for PageStatus
impl StructuralPartialEq for PageStatus
Auto Trait Implementations§
impl Forget for PageStatus
impl Freeze for PageStatus
impl RefUnwindSafe for PageStatus
impl Send for PageStatus
impl Sync for PageStatus
impl Unpin for PageStatus
impl UnsafeUnpin for PageStatus
impl UnwindSafe for PageStatus
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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
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> ⓘ
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